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: How to Track Who Is Sms Bombing Me . 4 Replies
1 mo ago -
Forum Thread: Removing Pay-as-You-Go Meter on Loan Phones. 1 Replies
1 mo ago -
Forum Thread: Hydra Syntax Issue Stops After 16 Attempts 3 Replies
2 mo ago -
Forum Thread: moab5.Sh Error While Running Metasploit 17 Replies
3 mo ago -
Forum Thread: Execute Reverse PHP Shell with Metasploit 1 Replies
4 mo ago -
Forum Thread: Install Metasploit Framework in Termux No Root Needed M-Wiz Tool 1 Replies
5 mo ago -
Forum Thread: Hack and Track People's Device Constantly Using TRAPE 35 Replies
5 mo ago -
Forum Thread: When My Kali Linux Finishes Installing (It Is Ready to Boot), and When I Try to Boot It All I Get Is a Black Screen. 8 Replies
6 mo ago -
Forum Thread: HACK ANDROID with KALI USING PORT FORWARDING(portmap.io) 12 Replies
6 mo ago -
Forum Thread: Hack Instagram Account Using BruteForce 208 Replies
7 mo ago -
Forum Thread: Metasploit reverse_tcp Handler Problem 47 Replies
9 mo ago -
Forum Thread: How to Train to Be an IT Security Professional (Ethical Hacker) 22 Replies
9 mo ago -
Metasploit Error: Handler Failed to Bind 41 Replies
9 mo ago -
Forum Thread: How to Hack Android Phone Using Same Wifi 21 Replies
9 mo ago -
How to: HACK Android Device with TermuX on Android | Part #1 - Over the Internet [Ultimate Guide] 177 Replies
9 mo ago -
How to: Crack Instagram Passwords Using Instainsane 36 Replies
9 mo ago -
Forum Thread: How to Hack an Android Device Remotely, to Gain Acces to Gmail, Facebook, Twitter and More 5 Replies
10 mo ago -
Forum Thread: How Many Hackers Have Played Watch_Dogs Game Before? 13 Replies
10 mo ago -
Forum Thread: How to Hack an Android Device with Only a Ip Adress 55 Replies
11 mo ago -
How to: Sign the APK File with Embedded Payload (The Ultimate Guide) 10 Replies
11 mo ago
-
How To: Spy on Traffic from a Smartphone with Wireshark
-
How To: Find Identifying Information from a Phone Number Using OSINT Tools
-
How To: Enumerate SMB with Enum4linux & Smbclient
-
How To: Detect Script-Kiddie Wi-Fi Jamming with Wireshark
-
How To: Use Burp & FoxyProxy to Easily Switch Between Proxy Settings
-
Hack Like a Pro: How to Find Directories in Websites Using DirBuster
-
Become an Elite Hacker Part 4: Hacking a Website. [Part 1]
-
How To: Perform Advanced Man-in-the-Middle Attacks with Xerosploit
-
How To: Escape Restricted Shell Environments on Linux
-
How To: Use MDK3 for Advanced Wi-Fi Jamming
-
How To: Use the Chrome Browser Secure Shell App to SSH into Remote Devices
-
How To: The Top 80+ Websites Available in the Tor Network
-
How To: Crack SSH Private Key Passwords with John the Ripper
-
How To: Find OSINT Data on License Plate Numbers with Skiptracer
-
How To: Brute-Force Nearly Any Website Login with Hatch
-
The Hacks of Mr. Robot: How to Send a Spoofed SMS Text Message
-
Video: How to Crack Weak Wi-Fi Passwords in Seconds with Airgeddon on Parrot OS
-
How To: Use an ESP8266 Beacon Spammer to Track Smartphone Users
-
How To: Create Packets from Scratch with Scapy for Scanning & DoSing
-
Antivirus Bypass: Friendly Reminder to Never Upload Your Samples to VirusTotal
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