Search:

Type: Posts; User: dougwilliams

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,724

    filename is a char*. I changed it to char[127]...

    filename is a char*. I changed it to char[127] and it works great. Thanks!

    I still don't understand why it works, because the printf was displaying the filename correctly. Yet, when it was passed...
  2. Replies
    3
    Views
    1,724

    trouble using string to open file

    I'm having trouble figuring out exactly why my program is telling me it can't find files, but i've narrowed it down.

    Here's a snippet of the code:




    char *filename;
    char ...
  3. Replies
    4
    Views
    5,651

    I was fortunate enough to find a custom method...

    I was fortunate enough to find a custom method for doing this with my data type:

    GTK Widget array
  4. Replies
    4
    Views
    5,651

    C equivalent of vector?

    I need to do something in C, but I am familiar with C++ where I could use a vector to store things of any type and access them by an index #. Is there a fairly simple way to get similar functionality...
  5. Replies
    6
    Views
    2,969

    Oops! Works like a charm, thanks.

    Oops! Works like a charm, thanks.
  6. Replies
    6
    Views
    2,969

    Shouldn't this code be able to fetch me all the...

    Shouldn't this code be able to fetch me all the integers on a line containing:

    "1 2 3 4 5 6 7 8 9 10 11 12" without quotes?


    char * pch;
    pch = strtok(theLine, " ");
    ...
  7. Replies
    6
    Views
    2,969

    Working pretty smoothly now, except the last line...

    Working pretty smoothly now, except the last line where I get a bunch of integers from the same line using:


    for (i=0; i<theListSize; i++)
    sscanf(theLine, "%d", &theList[i]);...
  8. Replies
    6
    Views
    2,969

    fscanf causing a crash

    I am using a simple file format, so I want to use fscanf to read the items in the file.

    The format:

    a string of words
    an_integer<tab>another_integer
    an_integer<tab>another_integer

    and so...
  9. Replies
    2
    Views
    930

    difficulty with char

    I am trying to get a line from a file and put it into a string.



    char theLine[1024];
    char aName[1024];

    fgets (theLine, 1024, infile); // infile is a file open for reading

    aName =...
  10. Replies
    3
    Views
    1,317

    array of a variable size

    One thing I never learned to do is create a variable sized array. The compiler always complained about it.

    I can do int theArray[10];

    but how do I do

    int theArray[numOfInts] ?

    Let's...
Results 1 to 10 of 10