Ok, this is gonna be a very short post but my question is I can't seem to figure what's wrong with my code when I run g++ through it to compile it. Whenever I add a semicolon after main() I keep getting expected unqualified id '{' token, but whenever I try it without the semicolon I get a ton of errors. Can anyone help me out? the code is here . Please and thanks. :)
Forum Thread: Coding Help
- Hot
- Active
-
Forum Thread: HACK ANDROID with KALI USING PORT FORWARDING(portmap.io) 12 Replies
1 day ago -
Forum Thread: Hydra Syntax Issue Stops After 16 Attempts 2 Replies
2 wks ago -
Forum Thread: Hack Instagram Account Using BruteForce 208 Replies
2 wks ago -
Forum Thread: Metasploit reverse_tcp Handler Problem 47 Replies
2 mo ago -
Forum Thread: How to Train to Be an IT Security Professional (Ethical Hacker) 22 Replies
2 mo ago -
Metasploit Error: Handler Failed to Bind 41 Replies
2 mo ago -
Forum Thread: How to Hack Android Phone Using Same Wifi 21 Replies
3 mo ago -
How to: HACK Android Device with TermuX on Android | Part #1 - Over the Internet [Ultimate Guide] 177 Replies
3 mo ago -
How to: Crack Instagram Passwords Using Instainsane 36 Replies
3 mo ago -
Forum Thread: How to Hack an Android Device Remotely, to Gain Acces to Gmail, Facebook, Twitter and More 5 Replies
3 mo ago -
Forum Thread: How Many Hackers Have Played Watch_Dogs Game Before? 13 Replies
3 mo ago -
Forum Thread: How to Hack an Android Device with Only a Ip Adress 55 Replies
4 mo ago -
How to: Sign the APK File with Embedded Payload (The Ultimate Guide) 10 Replies
4 mo ago -
Forum Thread: How to Run and Install Kali Linux on a Chromebook 18 Replies
5 mo ago -
Forum Thread: How to Find Admin Panel Page of a Website? 13 Replies
6 mo ago -
Forum Thread: can i run kali lenux in windows 10 without reboting my computer 4 Replies
6 mo ago -
Forum Thread: How to Hack School Website 11 Replies
6 mo ago -
Forum Thread: Make a Phishing Page for Harvesting Credentials Yourself 8 Replies
6 mo ago -
Forum Thread: Creating an Completely Undetectable Executable in Under 15 Minutes! 38 Replies
7 mo ago -
Forum Thread: Hacking with Ip Only Part [1] { by : Mohamed Ahmed } 5 Replies
8 mo ago
-
How To: Dox Anyone
-
How To: Use Burp & FoxyProxy to Easily Switch Between Proxy Settings
-
How To: Create a Persistent Back Door in Android Using Kali Linux:
-
How To: Spy on the Web Traffic for Any Computers on Your Network: An Intro to ARP Poisoning
-
How To: Exploit EternalBlue on Windows Server with Metasploit
-
How To: Find Identifying Information from a Phone Number Using OSINT Tools
-
How To: Use SQL Injection to Run OS Commands & Get a Shell
-
How To: Hack Apache Tomcat via Malicious WAR File Upload
-
How To: Use Ettercap to Intercept Passwords with ARP Spoofing
-
How To: Fuzz Parameters, Directories & More with Ffuf
-
Android for Hackers: How to Turn an Android Phone into a Hacking Device Without Root
-
How To: Scan for Vulnerabilities on Any Website Using Nikto
-
How To: Crack Password-Protected Microsoft Office Files, Including Word Docs & Excel Spreadsheets
-
How To: Brute-Force FTP Credentials & Get Server Access
-
How To: Brute-Force Nearly Any Website Login with Hatch
-
How To: Bypass File Upload Restrictions on Web Apps to Get a Shell
-
Tutorial: Create Wordlists with Crunch
-
Hacking macOS: How to Hack a Mac Password Without Changing It
-
How To: Stealthfully Sniff Wi-Fi Activity Without Connecting to a Target Router
-
How To: Use MDK3 for Advanced Wi-Fi Jamming
5 Responses
Remember, semi colons close statements... You can't end main() before you start it, so don't put a semi colon there. Pay attention to the "ton of errors", working to fix them one by one. For starters, you're missing semi colons on the end of lines: 12, 13, 16, and need to remove the semi colon at the end of line 17. I can see a couple more errors, but start with those and try to follow the error messages you get when you try to compile. Ex: Did you define all your variables? Are there any other misplaced semi colons? Add some indentation inside your braces (and after your for loop) too to make it more readable so you'll have an easier time following the code.
Thank you very much... I'm still new to c++ in general but thank you for the help. :)
Of course. Best way to learn is to do it, and then try to figure out each error one at a time. Once you think you fixed the first error, recompile and see if you get farther. Often times, fixing one error will make several of the subsequent errors vanish (or at least change to more helpful errors) as the compiler can now properly interpret the rest of the code.
Every great coder started where you are now. They're great now only because they didn't give up. Keep at it. You'll get there.
(whoops) Fixed my cin and cout errors. Except fstream is being a pain, does fstream usually causes problems? :/
What I don't understand is how this was compiled, if it was even compiled. What compiler are you using? Did you check any warnings/errors assuming your compiler failed to compile the code? Are you using the appropriate flags to check your code for errors? Did you do any research on any functions or operations? Looked at example code?
Share Your Thoughts