May 21, 2016 07:01 PM
(This post was last modified: Aug 11, 2016 05:49 PM by SureDawgg.)
Delete this thread please, thank you
|
C
Expected a declaration C++ |
|
May 21, 2016 07:01 PM
(This post was last modified: Aug 11, 2016 05:49 PM by SureDawgg.)
Delete this thread please, thank you
Here you go:
PHP Code You were missing the closing brace for your first function definition. ![]()
May 21, 2016 07:04 PM
(This post was last modified: May 21, 2016 07:05 PM by Shoe.)
You're defining main inside another function, first off. Apparently this is valid in C++? Dear God someone help me. One line's missing a semicolon according to the topmost issue, and the left brace somewhere isn't matched up, aka there's a brace somewhere that doesn't have a pair. Ex:
Code {where it should be: Code {
Moving on in life in such a way that doesn't include HF. HF allowed me to get into the security field and peaked my interest: I appreciate everyone's time, effort, and encouragement. If for some reason you have a means to message me outside HF, feel free to, but I won't be coming back.
1) You are using way more header files than necessary. Don't do that.
2) If you do use a lot of header files, especially 3rd party ones, don't use "using namespace std" because that can result in some pretty bad name mangling. 3) You're defining a function within a function. Either that, or you just forgot to close the function above. 4) This: PHP Code From what I can tell, std::cin.ignore() is probably what you can use. SRPP Discord Server
I am a professional network/cloud security architect. My Old Tutorials (May 22, 2016 11:03 AM)Mario® Wrote: I have updated the thread with a newer question You don't declare a function. You just write a scope that never gets run... there's no entry point. SRPP Discord Server
I am a professional network/cloud security architect. My Old Tutorials (May 22, 2016 01:07 PM)Remix Wrote: I assume it should be the main function so the header of the main function is missing void main()? 🤨 .. ?
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] (May 22, 2016 01:29 PM)Mario® Wrote: I did int main and it worked out fine I think you missed my point. I was hinting at the fact that it should be 'int main()' instead of 'void main()' as he had suggested.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] (May 22, 2016 01:21 PM)0xDEAD10CC Wrote: void main()? 🤨 .. ? My bad, I saw he returned nothing and didn't use my brain Has to be int |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Python] by Robin2Feb 10, 2018 04:35 AM | 0 | 116 |
Feb 10, 2018 04:35 AM Last Post: Robin2 |
| [C#] by HurdleMar 26, 2017 01:39 AM | 26 | 812 |
Mar 26, 2017 01:39 AM Last Post: Magna imperium |
| [C] by GoodiesSep 2, 2016 08:36 PM | 2 | 220 |
Sep 2, 2016 08:36 PM Last Post: Goodies |