//============================================================================
// Name : cppt1.cpp
// Author : Alex Herrmann
// Version :
// Copyright : 2011, crappy program!!
// Description : Hello World test programs in C++, Ansi-style
//============================================================================
#include <iostream>
#include <string>
usingnamespace std;
#define VER "0.0.0.a1 Pre-Alpha"
#define SEP " <-> "
int anm; //a nname variable, to count down from
int anmi; //name variable for isvalidmem
int anmc; //name variable for countdown
int a = 15; //Alex
int n = 12; //Natalie
int j = 11; //Johnny
int d = 42; //Dad
int m = 39; //Mom
int isvalidmemi (anmi)
{ //it gives error before this line
if (anmi == 'a' || 'A')
{
anm = a;
break;
}
elseif (anmi == 'n' || 'N')
{
anm = n;
break;
}
elseif (anmi == 'j' || 'J')
{
anm = j;
break;
}
elseif (anmi == 'd' || 'D')
{
anm = d;
break;
}
elseif (anmi == 'm' || 'M')
{
anm = m;
break;
}
else
{
cout << "are you stupid!!! i said you could pick >one< from >those< numbers"
}
countdown(anm);
}
int countdown (anmc)
{
int ac = a;
bool ishigher; //a boolean that tells us if it is higher or not
if anmc > a
{
ishigher = true
}
elseif anmc < a
{
ishigher = false
}
}
int main()
{
cout << "----------\n";
cout << "Hello World!!!\n"; // prints !!!Hello World!!!
cout << "----------\n";
int a = 15;
int n = 12;
int j = 11;
int d = 42;
int m = 39;
cout << a << SEP << n << SEP << j << SEP << d << SEP << m << "\n";
cout << "that is my family members ages!!! \n";
int theirage;
cout << "what is your age?!?: ";
cin >> theirage;
cout << theirage << "\n";
string aage = (theirage < a ? "little Baby!!" : "old fart...");
cout << aage;
cout << "lets do that again, \nbut this time we will use \\ a <sstream> \\\nor a string stream";
/* this next section makes use of several awesome things that c++ does*/
string m1;
int m1i;
string m2;
int m2i;
cout << "please enter one of the following letters; a n j d m : ";
cin >> m1;
cout << endln;
cout << "and agaiSn please: ";
cin >> m2;
cout << endl;
isvalidmemi(m1);
isvalidmemi(m2);
return 0;
}
line 26&61: wrong way to write function definition (the explanation is in the link)
line 29/34/39 etc. : comparison of two different types
line 56&67&71&etc: missing semicolon ';' - we need one after each statements
line 58: calling a function without a declaration
Thank you So much, compiling fine now!!
sorry about my terrible formatting, I was trying all sorts of different things to get it to work, and in the end, I probably just screwed myself over with all the unnecessary code!