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: Eml to PST Conversion 4 Replies
3 hrs ago -
Forum Thread: How to Install Kali Linux on Iphone or Ipad 26 Replies
1 day ago -
Forum Thread: How to Hack an Android Device with Only a Ip Adress 45 Replies
2 days ago -
Forum Thread: How to Use NGROK in a Reverse_Tcp Attack? 21 Replies
2 days ago -
Forum Thread: Hack Instagram Account Using BruteForce 191 Replies
3 days ago -
How to: Crack Instagram Passwords Using Instainsane 33 Replies
3 days ago -
Forum Thread: Track phone using imei number. 5 Replies
4 days ago -
Forum Thread: Security in IOT ( Internet of Things ) By [Mohamed Ahmed] 1 Replies
6 days ago -
Forum Thread: Kali linux command error. Kindly help 2 Replies
1 wk ago -
Forum Thread: When to Use Reverse Shell and Bind Shell? 5 Replies
1 wk ago -
Forum Thread: Fluxion Not Working 6 Replies
1 wk ago -
Forum Thread: Hacking Stream (LIVE) 10 Replies
1 wk ago -
Forum Thread: Blind SQL Injection 6 Replies
1 wk ago -
Forum Thread: Hacking Facebook,Twitter,Instagram Account Passwords with BruteForce 160 Replies
2 wks ago -
Forum Thread: Can C Programming Help Me for Hacking or Pen Testing. 10 Replies
2 wks ago -
Forum Thread: I Want to Hack in to My Friends System Through his wifi router i am controlling 7 Replies
2 wks ago -
Forum Thread: How to Use the Exploits Found in Vega Scan 3 Replies
3 wks ago -
Forum Thread: Can I Send a File to a Computer Using Ip Address 5 Replies
3 wks ago -
Forum Thread: Problem with Hacking Webserver with Armitage 11 Replies
3 wks ago -
Forum Thread: Metasploit - Embedding an Android Payload into a PDF? 7 Replies
3 wks ago
-
How To: Generate Crackable Wi-Fi Handshakes with an ESP8266-Based Test Network
-
How To: Brute-Force Nearly Any Website Login with Hatch
-
How To: Hack Android Using Kali (Remotely)
-
How To: Phish for Social Media & Other Account Passwords with BlackEye
-
How To: Top 10 Things to Do After Installing Kali Linux
-
How To: Scan for Vulnerabilities on Any Website Using Nikto
-
How To: Automate Remote SSH Control of Computers with Expect Scripts
-
How To: Gain SSH Access to Servers by Brute-Forcing Credentials
-
How To: Check if Your Wireless Network Adapter Supports Monitor Mode & Packet Injection
-
How To: Hunt Down Social Media Accounts by Usernames with Sherlock
-
How To: The Hacks Behind Cracking, Part 1: How to Bypass Software Registration
-
How To: Crack Shadow Hashes After Getting Root on a Linux System
-
How To: Find Identifying Information from a Phone Number Using OSINT Tools
-
How To: Find Anyone's Private Phone Number Using Facebook
-
How To: Crack SSH Private Key Passwords with John the Ripper
-
Android for Hackers: How to Turn an Android Phone into a Hacking Device Without Root
-
How To: Write an XSS Cookie Stealer in JavaScript to Steal Passwords
-
How To: Spy on Traffic from a Smartphone with Wireshark
-
Hack Like a Pro: How to Hack Facebook (Facebook Password Extractor)
-
How To: 4 Ways to Crack a Facebook Password & How to Protect Yourself from Them
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