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...
Type: Posts; User: dougwilliams
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...
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 ...
I was fortunate enough to find a custom method for doing this with my data type:
GTK Widget array
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...
Oops! Works like a charm, thanks.
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, " ");
...
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]);...
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...
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 =...
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...