Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 25
Guests Online: 23
Members Online: 2

Registered Members: 82903
Newest Member: Piriformis
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

C++ pinger coding... help please

lukem_95
Member

Your avatar

Posts: 232
Location: 127.0.0.1:80
Joined: 05.07.06
Rank:
Apprentice
Warn Level: 5
Posted on 02-09-06 19:59
ok im pretty new to programming in C++, but i thought i was doing pretty well, iv had the sams learn c++ in 24 hours book for a couple of months but only just started learning it, i tried to build a pinger however ran into some errors, my compiler simply says:

Error: Unresolved external '_main' reference from C:\CBUILDERX\LIB\COX32.OBJ

ILINK32 exited with error code: 2
Build Canceled due to errors


I think this has something to do with my compiler but im not sure, so i will post my C++ incase something is the matter with that.

Please help, im keen to learn the language as so far i can only really code web languages.

Code

#include<iostream>
#include<windows.h>
#include<dos.h>

using namespace std;

int Main()
{
  start:

  char tarUrl;
  int tarPing;
  int counter;

  system("title Pinger");
  cout << "Please enter the website you wish to ping (e.g. google.com): ";
  cin >> tarUrl;
  cout << "\n\n Thankyou, how many times would you like to ping ";
  cout << tarUrl;
  cout << "?:";
  cin >> tarPing;
  cout << "\n\n Starting to ping...";

  counter = 0;

  if(counter < tarPing)
  {
    system("ping "+tarUrl);
    counter++;
    cout << "Pinged ";
    cout << tarUrl;
    cout << counter;
    cout << " times!";
    system("cls");
  } else {
    cout << "Pinging Completed! Pinged ";
    cout << tarUrl;
    cout << " ";
    cout << counter;
    cout << " times!";
  }

  cin.get();
  goto start;
}






EDIT: like i said i know the code is n00by, please dont flame me on my use of system commands etc, as i dont know any other code to use, if you want to suggest any i would appreaciate that.




Edited by lukem_95 on 02-09-06 20:00
www.hellboundhackers.org/news.php?logout=yes
Author

RE: C++ pinger coding... help please


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 02-09-06 20:39
Code
int main()



Not
Code
int Main()


Author

RE: C++ pinger coding... help please

lukem_95
Member

Your avatar

Posts: 232
Location: 127.0.0.1:80
Joined: 05.07.06
Rank:
Apprentice
Warn Level: 5
Posted on 02-09-06 20:41
ah thankyou, that sorted it out, tysm




Edited by lukem_95 on 02-09-06 20:42
www.hellboundhackers.org/news.php?logout=yes