So basically before i write this code down as a example code for declaring voids i want to make sure it works. So i quickly drew out this code:
Code: Select all
/* This is the system boot section where it loads headers for the program. */
#include "stdafx.h"
#include <iostream>
using namespace std;
/* Declaration section of the program */
void function1()
{
cout << "Function 1 loaded.\n";
}
void function2()
{
cout << "Function 2 loaded.\n";
}
void function3()
{
cout << "Function 3 loaded.\n";
}
/* Main function section */
int main()
{
int thenumber 76;
int playerguess;
cout << "Lets play guess my number, type a number between 0-100.\n";
cin >> playerguess;
if (playerguess == thenumber)
cout << "You won!\n";
else
cout << "Try again...\n";
function1();
function2();
function3();
char f;
cin >> f;
return 0;
}
Code: Select all
1>------ Build started: Project: Example of a declared code, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>AssemblyInfo.cpp
1>Example of a declared code.cpp
[color=#FF0000]1>.\Example of a declared code.cpp(28) : error C2143: syntax error : missing ';' before 'constant'[/color]
1>Generating Code...
1>Build log was saved at "file://c:\Users\Kyle\Documents\Visual Studio 2008\Projects\Example of a declared code\Example of a declared code\Debug\BuildLog.htm"
1>Example of a declared code - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========