Im all new to the world of programming.. I just started learning C++ yesterday and i have Visual Studio 2010. First off, how do i test my codes? And i have a few simple codes for you cuz i just want to make sure i have the right technique and doing it right.
PS these are just so i can get the concept. Simple tasks were made a little more complicates so i can get down variables, and other things.
Variables and arithmatic:
Code:
#include <iostream>
using namespace std;
int var1 = 45;
int main()
{
cout << "Value of variable 1: " << var1 << endl;
int sum = var1 + 7;
cout << "Value of variable 1 plus 7: " << sum << endl;
return 0;
}
Hello World:
Code:
#include <iostream>
using namespace std ;
void message(), secondmessage(), thirdmessage();
int main()
{
cout << "Hello World" << endl;
message();
cout << "Made by FuRy" << endl;
secondmessage();
thirdmessage();
return 0;
}
void message()
{
cout << "This is a simple program..." << endl;
}
void secdondmessage()
{
cout << "This program can now terminate" << endl;
}
void thirdmessage()
{
cout << "If i got the code right... xP" << endl;
}