User forums > General (but related to Code::Blocks)

Help with file loader

(1/1)

OctavariumXI:
Aight, for the past week or so, I've been working on a custom-algorithm generated line-drawer, and just now I'm starting on a header file with the functions to load algorithms from a text file.

For some odd reason, whenever I use fscanf or fgetc, all it does is return a random integer or letter.

Here's the code;


--- Code: ---FILE *file = fopen( "used_alg.alg" , "r+" );
while ( a <= 3 ){
        test = fgetc(file);
        cout << xres[a] << endl;
        ++a;}
--- End code ---

In which xres[] is an integer array of 4.

Any reason why it's not working? >_<

ollydbg:
Please ask this question to some C/C++ forum. Codeblocks forum doesn't discuss these kind of questions.

Navigation

[0] Message Index

Go to full version