- Code: Select all
FILE *f=fopen("00base.mu","w");
fprintf(f,"VERSION 3\nOWNALLIANCE 0\nDIFFICULTY 1\nTOTALNUMSIDES 1\nNUMDRIVEABLES 1\nMONTH 1\nWORLDGRID 2\nLATLONG 54.071823 -11.025635\n;\nSEASTATE %i\nMDR 0 0 0\nBOTTOMTYPE %i\nTIMEOFDAY %i\nWEATHER %i\nCLOUDHEIGHT %i\nSSP %i\n\n\nENTITY 2342 SUBENTITY\nHULLID 1\nALLIANCE 1\nPOS 554859.937500 559978.937500 -70\nPOINTS 750\nCOURSE 0\nSPEED 5\nPROB 100\nDRIVEABLE 1\nUNIQUENAME ""SSN"" \nCOMMSINTERVAL 0.000000\nTACTIC RANDOMBOX\nBOX 515385.812500 601426.937500 594334.187500 518531.031250\nAIRLOADOUT 244\nAIRCRAFT 1722 1 Alert5 0 : Alert15 1 : 0 Alert30 0 : \nEND\n", seastate, bottomtype, timeofday, weather, clouds, ssp);
fclose(f);
Making it more clear:
- Code: Select all
FILE *f=fopen("00base.mu","w");
fprintf(f,"\nBOTTOMTYPE %i\nTIMEOFDAY %i", bottomtype, timeofday);
fclose(f);
So the %i places the final variables in the order written.
And now all the text appears on the text file
Don't relax, surely I will come back with more questions...
Thank You all for your help!