I'm new to programming, but with every program I do, I end up with one error. For some reason, I can't figure out how to install MSDN, so I can't press F1 for it to tell me what to fix. Here's my current code:
Anyone see any obvious discrepancies?Code:#include <iostream.h> char WhatToDo() { cout << "What do you want to do?\n\n"; return 0; } char OpenGate() { cout << "You open the gate and step inside the yard. You marvel at the fact that even\n"; cout << "though this yard is tiny, there has apparently been no effort expended toward\n"; cout << "it's upkeep. You hear what could be muffled growling coming from your left.\n\n"; WhatToDo(); return 0; } int main() { char a; cout << "You are standing in front of a run-down house. There is a blue sportscar that\n"; cout << "looks like it hasn't been driven in years parked out front. The car is covered\n"; cout << "in leaves. The house itself looks like it could collapse at any moment.\n"; cout << "There is a chain-link fence surrounding the house. The house has a screened-in\n"; cout << "porch, but you can't see much beyond that. Planted in the yard are trees which,\n"; cout << "if properly pruned, were probably nice bushes at one time. There is a closed\n"; cout << "gate which leads through the fence.\n\n"; WhatToDo(); cin >> a; if (a = "open gate") OpenGate(); else cout << "Please enter a valid command.\n"; return 0; }



LinkBack URL
About LinkBacks


