Computing.Net > Forums > Programming > c++ help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

c++ help

Reply to Message Icon

Name: gorf
Date: September 13, 2003 at 09:54:57 Pacific
OS: winxp
CPU/Ram: 1gb
Comment:

how would i do something like this im useing dev-c++
EX:

for (int i=number; i255; i++)

system ("ping 192.168.1."i); // this part i dont know how to get the number there ? thx



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: September 13, 2003 at 10:30:37 Pacific
Reply:

It's pretty easy to do, but what is your purpose for having a C++ program that issues a bunch of ping commands. Given that you won't see the results, what's the point??

I can't think of any 'productive' use.



0

Response Number 2
Name: gorf
Date: September 13, 2003 at 10:45:11 Pacific
Reply:

im just learing how to place codes in other whys i was just using system("ping") as EXp:


0

Response Number 3
Name: Don Arnett
Date: September 13, 2003 at 12:30:26 Pacific
Reply:

Before the loop:

char buffer[50];


Inside the loop:

sprintf(buffer,"ping 192.168.1.%d",i);
system(buffer);

sprintf() is like fprintf() except that it writes it's output to the memory pointed to by the first parameter instead of to a file.



0

Response Number 4
Name: gorf
Date: September 13, 2003 at 13:12:42 Pacific
Reply:

thank you


0

Response Number 5
Name: Fozzie
Date: September 13, 2003 at 18:30:22 Pacific
Reply:

When I am online using my dial-up connection, my firewall is constantly blocking ping requests. In less than one hour, it will usually receive close to two hundred such requests! They come from different I.P. addresses but all of the I.P.'s are originating from the same general location.

I'm not convinced that gorf has no ulterior motives in wanting to know how to accomplish this task.

Why would someone want to send so many requests? Is this likely an attempt to burn up a hosting company's bandwidth? What would happen if my firewall let my computer respond to these pings? Anyone have any thoeries or knowledge about this subject?


0

Related Posts

See More



Response Number 6
Name: ffxifanatic
Date: September 13, 2003 at 19:28:43 Pacific
Reply:

Actually using c++ to loop ping commands is a great way to attack servers or unprotected IP addresses. Ask CNN when a "hacker" used this technique to flood their system with pings....it couldn't handle so many because the computer is forced to answer every ping.........


0

Response Number 7
Name: Infinite Recursion
Date: September 14, 2003 at 20:39:32 Pacific
Reply:

I see no productive need for this pinging loop... especially when one ping to a particular IP is all you need for any valid testing procedure, local or remote.

Sounds like a "wanna-be hacker" toy to me, denial of service tool... etc. Well, I need not point fingers, I don't know the intentions here, but chances are... they are not productive.

IR


0

Response Number 8
Name: ffxifanatic
Date: September 15, 2003 at 04:02:51 Pacific
Reply:

errr, i just said that above you....;)


0

Response Number 9
Name: Infinite Recursion
Date: September 15, 2003 at 08:12:43 Pacific
Reply:

Arghh. It wasn't verbatim... just putting a fine point on it. >;)


0

Response Number 10
Name: gorf
Date: September 17, 2003 at 08:52:43 Pacific
Reply:

The Story of the PING Program

the story about ping



0

Response Number 11
Name: saddam
Date: October 11, 2003 at 19:50:29 Pacific
Reply:

clicks my memories!!

i was attempting to write a batch file that uses a for loop to invoke the "net send" command to send messges to all subnets in my campus network in a single click! now that time is on my side, i try that again!

thanks folks!


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: c++ help

Simple C Help!!! www.computing.net/answers/programming/simple-c-help/9795.html

C# help www.computing.net/answers/programming/c-help/3176.html

help help!!!..C...data file..please www.computing.net/answers/programming/help-helpcdata-fileplease/8092.html