Problem: the first letter in my strings are being truncated except the first string.
Ok, when I have problems I do try to search ebay, use the search function of the forums, so if I'm asking a often asked question, sorry I tried, alright on to the problem.
I'm writing a program to input user info/stats and output html, as a way to learn basic C++ coding and make something kinda usefull ;). I go through all the input, and when I check the HTML the first letter in all the places where a variable was, is "truncated" from the beginning by one character.
Here's the code (Also any input on how to display quotes other than << (char) 34 << would be appreciated ;) ):
Code:
//---Header---//
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <fstream>
//---End Header---//
//---Shortcuts---//
using namespace std;
//---End Shortcuts---//
int main(int argc, char *argv[])
{
string NewPlayerName;
string PlayerName;
string FileName;
string ProfilePicName;
cout<<"New Player\n\n";
cout<<"First/Last Name: ";
cin.get();
getline(cin , NewPlayerName , '\n');
PlayerName = NewPlayerName;
FileName = NewPlayerName += ".html";
ofstream Playername( FileName.c_str() );
//Where I would have loads of HTML
cout<< NewPlayerName << "\n";
cout<< FileName << "\n";
cout<<"Profile Picture Name (Include the extension ex: .jpg): ";
cin.get();
getline(cin , ProfilePicName , '\n');
cout<< ProfilePicName;
Playername<< PlayerName << "," << FileName << "," << ProfilePicName << "\n";
system("PAUSE");
return EXIT_SUCCESS;
}
//That's better ;)