Hi all, huge noob here.
Ive only ever used one scripting language prior to my jump, and these are my early days of C++, please excuse my ignorance.
I have been reading the brilliant tuts on your site, and decided to register on the forums to try and find out a way to convert a long type var to a string.
After reading the FAQs I found a solution which worked fine on its own, and highly delighted me.
However: This hurled me into another problem which I cannot find the answer to at my present level of experience with C++.
My problem is that when I tried to use the code I found in my own project it failed to output anything at all.
I have stripped it down to its bare bones to demonstrate my problem, and hope someone can help me understand my error(s).
Code:
#include <iostream>
#include <sstream>
#include <string>
#include <Windows.h>
std::string IntToString ( int number )
{
std::ostringstream oss;
// Works just like cout
oss<< number;
// Return the underlying string
return oss.str();
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
std::cout<< "Hi World" << "\n";
system("Pause");
return 0;
}
std::cout<< "Hi World" << "\n"; shows nothing at all.
I would really appreciate any help.