User Profile

Collapse

Profile Sidebar

Collapse
prads
prads
Last Activity: Feb 11 '08, 11:01 AM
Joined: Oct 21 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • prads
    started a topic Verify the two codes please...
    in C

    Verify the two codes please...

    Hello,
    I have two codes here. Matlab code is the reference code and I have written this C++ code from that.Don’t worry about the values because i just want to know if the logic of the C++ code is same as MATLAB code coz I am getting some incorrect values as output. However I have declared a few values so that u get some clue of its datatype.
    Promptcode, earlycode and latecode each has a random combination of +/- 1’s.
    Cacode...
    See more | Go to post

  • prads
    started a topic int *x=new int[38200]; is this correct??
    in C

    int *x=new int[38200]; is this correct??

    Hello,
    I have done the following initialization in my C++ code:
    int *x=new int[38200];
    However a doubt arouse to me now..... int can take values only from 2^15 to (2^15)-1..........So do i have to change it to something like
    long int *x=new long int[38200] or is it ok coz its allocating dynamic memory?? If I have to change, then what should it be i.e is my new initialization correct?
    Thanks,
    prads
    See more | Go to post

  • prads
    started a topic For loop not executing enough times.
    in C

    For loop not executing enough times.

    hello,
    this pgm of mine should loop codeperiod(3700 0 in this case) no. of times. However its doin it for just 3 times. Pls help. Also i think there is an exception arising somewer in my pgm nd i need to write a try-catch but dont know wat statements to write within tat. Somebody pls help me out.
    Thanks,
    prads

    Code:
    for(loopcnt=0;loopcnt<codeperiods;loopcnt++)// what is codeperiods..37000 ???
    ...
    See more | Go to post

  • prads
    replied to Incorrect length output in File read in C++
    in C
    im sorry but didnt understand a word!!! :)
    See more | Go to post

    Leave a comment:


  • prads
    started a topic Output Window flashes and closes
    in C

    Output Window flashes and closes

    Hello,
    Though I have given getchar(); at the end of my C++ program, it displays the output but the cmd window just flashes and closes immediately. It is a huge pgm of abt 500+ lines and deals with a lot of data. So can anyone tell me how i shud retain the cmnd window so that i can know my output?? I also tried system("pause") ; but with no help. Pls tell me what has to be done?
    Thanks,
    prads
    See more | Go to post

  • prads
    replied to Incorrect length output in File read in C++
    in C
    oh!...so is there any way out......i.e any other cmnd tat works well with .bin files....
    See more | Go to post

    Leave a comment:


  • prads
    started a topic Incorrect length output in File read in C++
    in C

    Incorrect length output in File read in C++

    Hello,
    The pgm below opens a file, reads it and displays the contents and its length.
    However it displays a length of (length+2) and also the samplesread as (samplesread +2), where samplesread is the length obtaines from gcount(), and length from tellg(). Pls tell me how i should get the correct length and samplesread??. Also if i enter the data in my file in the next line, it considers "\n" towards the length count. Pls correct...
    See more | Go to post
    Last edited by sicarie; Nov 7 '07, 02:13 PM. Reason: Non-formatted code annoys me

  • prads
    replied to waitbar function error. Pls help
    in C
    I am sorry........li ne 39 in my code corresponds to 18 in the above code. i.e the error is in DEFUN_DLD()
    Thanks,
    prads
    See more | Go to post

    Leave a comment:


  • prads
    replied to waitbar function error. Pls help
    in C
    It shows the foll errors.....

    octave/oct.h: No such file or directory.
    39 expected constructor, destructor, or type conversion before '(' token
    39 expected `,' or `;' before '(' token

    Thanks,
    Prads
    See more | Go to post

    Leave a comment:


  • prads
    started a topic struct redeclare problem
    in C

    struct redeclare problem

    hello,
    i have a struct and have declared it as shown below. If i print its value in the main() fn it prints it correctly.Howev er if i declare the struct again in the main() and try to print its value it doesnot give me the correct value but prints some garbage value. Why is it so? Is there any way to correct it because i think i have to declare it again in main() for initializing other variables.
    thanks,
    prads

    ...
    See more | Go to post

  • prads
    started a topic output error while displaying read file!
    in C

    output error while displaying read file!

    Hello, the foll pgm displays some wierd looking characters at the output when cout<<buffer<< is done. Pls tell me why it happens and also correct the error.
    Thanks,
    Prads

    [code=cpp]
    int main ()
    {
    int length;
    char * buffer;
    size_t samples_read;

    ifstream is; //is is the fid
    is.open ("C:\\t1.txt ", ios::binary );

    //...
    See more | Go to post
    Last edited by sicarie; Nov 5 '07, 05:25 PM. Reason: Code tags are [code=cpp] code goes here [/code]. Please use them

  • prads
    started a topic Transpose of a non-square matrix
    in C

    Transpose of a non-square matrix

    Hello,
    Can anybody tell me how i shud go about to perform the transpose of a nonsquare matrix array. Pls give me an idea so that i can write one based on that and then post queries if errors r found. Say i have an array a[10] whose transpose is reqd?
    Thanks,
    Prads
    See more | Go to post

  • prads
    started a topic waitbar function error. Pls help
    in C

    waitbar function error. Pls help

    Hello,
    this waitbar function (similar to the one in matlab) in C++ pops an error. Pls correct the error for me.
    Thanks,
    prads
    [code=cpp]
    <code>

    #include <octave/oct.h>
    #if defined (HAVE_TERM_H)
    # include <term.h>
    #elif defined (HAVE_TERMCAP_H )
    # include <termcap.h>
    #endif

    #define BUF_SIZE 256
    #define MAX_LEN 240...
    See more | Go to post
    Last edited by weaknessforcats; Nov 4 '07, 04:09 PM. Reason: Please use [code=cpp] or [code=c] and [/code] tags

  • prads
    replied to C++ equivalent of matlab
    in C
    Hello,
    I am writing a C++ program for tracking of GPS signals using matlab code as reference. I came across these lines in the code and wondered if i cud do it in C++ as well.......henc e the question....Pls let me know how to do th same...
    Thanks,
    Prads
    See more | Go to post

    Leave a comment:


  • prads
    started a topic File Open and Read in C++
    in C

    File Open and Read in C++

    Hello,
    The C++ pgm below opens a file, reads it and displays what is read. However at the end of the output it also appends some crazy looking characters. Pls correct it for me.
    Thanks,
    Prads
    <code>
    #include <iostream>
    #include <cstdio>
    #include <cstdlib>

    using namespace std;
    int main ()
    {
    FILE * pFile;
    long lSize;
    char...
    See more | Go to post

  • prads
    started a topic C++ equivalent of matlab
    in C

    C++ equivalent of matlab

    Hello,
    I want to write the following matlab code lines in C++. Somebody pls help me...
    and one more basic question.....wh at is C++ equivalent of matlab fid...is it
    rawsignal in:
    file_op.getline (rawsignal,blks ize);
    Thanks,
    Prads

    <code>
    1) fseek(fid,5,'bo f');

    2) try
    waitbar(loopCnt/codePeriods, ...
    hwb, ...
    ['Tracking: Ch ', int2str(channel Nr),...
    See more | Go to post

  • prads
    started a topic waitbar function error
    in C

    waitbar function error

    Hello,
    I found this waitbar functioning pgm in a forum which does the same work as a matlab waitbar. However this pgm has an error and i cudnot figure it out. Can anyone pls correct it.
    Thanks,
    Prads
    [code=c]
    /*************** *************** *************** *************** **************
    * Waitbar function -- displays progress of lengthy calculations
    * -------------------------------------------------------------...
    See more | Go to post

  • prads
    replied to Function not returning correct values
    in C
    hey great!....thank s that works.........
    See more | Go to post

    Leave a comment:


  • prads
    replied to Function not returning correct values
    in C
    I am sorry but I couldnot understand much from that and with whatever I interpreted, I couldnot get the output. So can u pls make the required changes to my program and post it..
    thanks,
    prads...
    See more | Go to post

    Leave a comment:


  • prads
    started a topic Function not returning correct values
    in C

    Function not returning correct values

    Hello,
    the following code doesnot return the corect values to the main function. However it prints the correct values within the function. Also the same when written in C works absolutely fine. Pls tell me where im going wrong and correct me. U can run it and check!
    Thanks
    Prads

    [code=cpp]
    #include <iostream>
    #include <fstream>
    #include <cstring>
    #include <cmath>...
    See more | Go to post
    Last edited by sicarie; Nov 1 '07, 04:23 AM. Reason: Code tags
No activity results to display
Show More
Working...