windows and files, why can't we get along?

Started by
10 comments, last by Malchivus 20 years, 6 months ago
Try cut and pasting llyod''s code to start with. Take what he wrote and try it in a brand new project.

The macro thing you have looks complicated, though i don''t see any obvious errors in it. You are only using one of those two at a time, right? I usually go with FILE and don''t mess with any wrapping of it.


As for your program''s splash screen:
Project->Settings:
c/c++:
category(dropdown)->customize:
suppress startup banner.
I actually don''t know if this is the right thing. It''s an option that is always clicked off for me, and turning it back on didn''t change my program or MSVC. It could just be part of the student version you have.

can you access a file you know you have like so:?
//------------------
#include <stdio.h>
int main()
{
FILE *file;
file = fopen( "c:\\autoexec.bat","rt" );
if( file ) printf("It worked\n");
else printf("It didn''t work.\n");
}
//------------------

Advertisement
ok i''v been a bit stupid with this . . when i ran the program i usualy copied the file i wanted to read into the /debug and then clicked ''run'' in msvc, this made the home directory the parent (not debug) so it wasn''t finding the file, i then tried the lopen stuff and at that point added error checking . . don''t know why that made so many complaints but . . finaly the line fgetc didn''t read like that until recently so when i used the fscanf i think it must have goten something weird which is why later on (erp) the program was trying to allocate 4gb of memory.

my lesson to myself: always make sure i''m running from the righ directory before i try to debug, and make sure i isolat the error

i hate how whenever i post on here its a question i should already know the answer too . . well except for the fwrite thing, but that was easy enough to work around
I just wanna get this done.

This topic is closed to new replies.

Advertisement