| | |
Need Help Quickly
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2005
Posts: 2
Reputation:
Solved Threads: 0
My Program :
<< moderator edit: added [code][/code] tags >>
Will not work It comes up with the error message "Line 11 `main' must"
How do i fix this thanks
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> using namespace std; void Reverse(string &InputString); void CharSwap(char& First, char& Second); void main(void) { string InputString; cout << "Please enter the string to reverse ==> "; getline(cin, InputString); cout << endl << "You entered the (" << InputString.length() << ") char long string: "; for(int i = 0; i < InputString.length(); i++) cout << InputString[i]; Reverse(InputString); cout << endl << "The string reversed is : "; for(int j = InputString.length(); j > 0 ; j--) cout << InputString[j]; cout << endl << endl; } void Reverse(string &InputString) { int Begin = 1, End = InputString.length(); while(Begin < End) { CharSwap(InputString[Begin], InputString[End]); Begin++; End--; } } void CharSwap(char& First, char& Second) { char Temp; First = Second; Temp = First; Second = Temp; }
Will not work It comes up with the error message "Line 11 `main' must"
How do i fix this thanks
•
•
•
•
Originally Posted by hazzo
Will not work It comes up with the error message "Line 11 `main' must"
•
•
•
•
Originally Posted by hazzo
How do i fix this
C++ Syntax (Toggle Plain Text)
int main() { // ... return 0; }
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Where you have Change it to Then return a value before the last }.
void main(void)int main(void) "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- How to Quickly Lock Your Computer and Use Other Windows Logo Shortcut Keys (Windows tips 'n' tweaks)
- My media plays too quickly?? Anyone else run into this before? (Troubleshooting Dead Machines)
- Straight C (C++)
- Paid inclusion will index quickly? (Pay-Per-Click Advertising)
- Mission See How Quickly I Can Totally Hose Windows98 (Geeks' Lounge)
- PHP, ASP, ColdFusion, what's your fav? (IT Professionals' Lounge)
- Windows 2000 Adv Server and "Printing Subsystem" (Windows NT / 2000 / XP)
- TechTalkGal has gotten hurt (Geeks' Lounge)
- Downloading from IE (Web Browsers)
- Linux/UNIX (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: why use c?
- Next Thread: How to recieve input from user such as "#help"
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll download dynamic encryption error file forms fstream function functions game generator getline givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






