So create a function called 'initGlobalVariables' which is called right at the start of main.
Why is doing it once at the start of main such a big issue to you?
Put it inside main.
C has no concept of having executable code outside of functions. C++ can do it, but that's only for constructing global...
Aside from the fact that it doesn't compile since you commented out
You also seem to have removed (or it was never there to...
Well if you're going to continue to use the C API in a C++ program (I don't recommend it), then it would be
fprintf(newfile,"1" " %s" " %s",...
Evaluation of precedence and evaluation of side effects are NOT synchronised in any way. Read the FAQ and try to get to grips with "before",...
> The correct answer will be 22,13,14,14
That's no more correct than any other explanation.
So when you run your test data through your program, what do you see?
- does it crash (all the time, some of the time, specific test case)
C doesn't care about file extensions.
FILE *in = fopen("file.dat","rb");
FILE *out= fopen("file.txt","w");
Then you can do whatever you...
The typedef just creates an alias (a single word), for some other type. Some types in C can be fairly complicated and it gets tedious and error...
So separate the steps,
- read characters until you reach >
- push the resulting string onto a stack.
This should be a trivial problem...
while ( ch != '>' )
Step 1, work on the indentation. Consistent and clear indentation will save you from an awful lot of mistakes, and make it much easier for anyone...
Use fopen() to open the file for input.
Use fscanf() to read each successive integer from the file. I would suggest using the %d format.
> You know you canny use STL in i960 processor due to PCR 4 level of compiler.
Do you have any references for this rather bold assertion?
> but can u tell why we get such an output.
Because your code is broken.
Broken code produces whatever it feels like, regardless of what you...
A lot of people having problems sleeping it seems.
Well if you had this
Then there may be the possibility that myHeader.h depends on other.h in some...
Separate names with a comma.