-
I was trying to create a file, like:
CreateFile("C:\\windows\\desktop\\var.txt", ... );
but I can't figure out how to change "var" to whatever I want as in javascript you can do:
alert("hello, " +name+"!");
where "name" is an input, how can i do this in C++? Sorry if i am being incoherent, but i don't really know how to say it.
-
I know what you mean. You can do it using the very handy sprintf() function. I expect (hope) you've used printf() to print out variables and strings to a console window before, using a format string. sprintf() works exactly the same way, but you specify a destination string to print to as the first argument.