Im getting confused i check the msdn library and see that there are functions for win32 apps to open files and handle 'em.
Code:
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
int WINAPI WinMain()
{
open_file();
return 0;
}
int open_file(){
FILE *fl;
fl=fopen("C:\\windows\\desktop\\shutd.txt", "w");
if(fl == NULL ){
printf("Couldnt create file\n");
}
else{
fprintf(fl,"Apparently this is working\n");
printf("It worked");
fclose(fl);
}
return 0;
}
As you can see its a win32 application. Now how come that this does creates a file called shutd.txt containing the line "Apparently this is working" but doesnt displays my message ( It worked).... i mean how do you know if a function can be used in a win32 application or not, i could use the functions from the msdn library to open a file or i could use the functions according to the ANSI C... wich do you choose.
Since ive always programmed for console app ive never had to deal with functions like " public static File open( String path )---according to the msdn lib"....
Any link or suggestion that can clear the sky for me would be welcome.
P.S: Dont be too hard for me when u'v read this like "WHAa what an idiot." ( I'm just a kiddo trying to learn )