Hi
i'm trying to get the user to enter a string as the save name then to save it as a text file under that string. I'm a beginer to c but have used other languages if that helps. (this needs to be done in c as it is part of a project) heres what i've guessed at
i've had a look around and fstream has been mentioned but after trying this i get more errors.Code:char teststring[51]; FILE * testFILE; /* program code here*/ printf("please enter the save name?"); scanf("%s",&teststring); testFILE = fopen ("F:\\Programming_output\\"+teststring+".txt","w"); fprintf(testFILE, "saved data here"); fclose (testFILE);



LinkBack URL
About LinkBacks



