Post by devguy on Aug 29, 2015 16:05:06 GMT -5
Example 1 - Making a console application
std::cout outputs an standard text - don't forget using namespace std;
int main() is the main entry point for that application
Example 2 - Variables (Strings)
Example 3 - Variables (Integer)
Example 4 - MessageBox
#include <iostream>
using namespace std;
int main() {
std::cout << "Hello World" << std::endl;
return 0;
}
std::cout outputs an standard text - don't forget using namespace std;
int main() is the main entry point for that application
Example 2 - Variables (Strings)
#include <iostream>
using namespace std;
int main() {
string HelloWorld = "Hello World";
std::cout << HelloWorld << std::endl;
return 0;
}
Example 3 - Variables (Integer)
#include <iostream>
using namespace std;
int a = 5;
int b = 3;
int c = a + b;
int main() {
std::cout << c << std::endl;
return 0;
}
Example 4 - MessageBox
#include <windows.h>
int main() {
MessageBox(NULL,"Hello World!","Hey",MB_ICONINFORMATION|MB_OK);
return 0;
}