So. I have a string that I create within a file and I want to put spaces,new lines and add some input in the code but it doesn't work.
I tried putting ""
between the text as I saw online but it doesn't work. And the new lines I didn't found on the internet.
Im trying to create a file with this code in it and this is how I got it to even create the file.
set /p CPPFileName=
echo ^#include^<fstream^>usingnamespacestd^;ifstreamfin(^"^")^;ofstreafout(^"^")^;int main^(^)^{inta^,b^;fin^>^>a^>^>b^;fout^<^<a^*b^;^} > "%CPPFileName%"
And this is the output
#include<fstream>usingnamespacestd;ifstreamfin("");ofstreafout("");int main(){inta,b;fin>>a>>b;fout<<a*b;}
But I want this to be the output using Spaces And New lines
#include<fstream>
usingnamespace std;
ifstream fin("");
ofstreaf out("");
int main()
{
int a,b;
fin>>a>>b;
fout<<a*b;
}
And also about Inserting text.
I have 2 Inputs and the name of the strings are File1Name
and File2Name
Is there a way I could add these strings in the code string I want to output?
Like ^#include^<fstream^>usingnamespacestd^;ifstreamfin(^"%File1Name%^")^;ofstreafout(^"%File2Name%^")^;int main^(^)^{inta^,b^;fin^>^>a^>^>b^;fout^<^<a^*b^;^}
If you could help me it would be awesome!