# c plus plus question

**URL:** <https://boards.straightdope.com/t/c-plus-plus-question/50780>\
**Category:** Factual Questions\
**Created:** [January 19, 2001, 12:28am UTC](https://boards.straightdope.com/t/c-plus-plus-question/50780 "2001-01-19T00:28:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cykrider](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@cykrider](https://boards.straightdope.com/u/cykrider)\
**Post date:** [January 19, 2001, 12:28am UTC](https://boards.straightdope.com/t/c-plus-plus-question/50780/1 "2001-01-19T00:28:06Z")

</div>

Is it possible to ping another computer using c++ and save the results in a text file or something?

---

<div class="post-metadata">

**Author:** ![Arjuna34](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Arjuna34](https://boards.straightdope.com/u/Arjuna34)\
**Post date:** [January 19, 2001, 12:46am UTC](https://boards.straightdope.com/t/c-plus-plus-question/50780/2 "2001-01-19T00:46:56Z")

</div>

Typing “ping.cpp” into [http://www.google.com](http://www.google.com) resulted in many links, including [this one](http://fiddle.visc.vt.edu/courses/ecpe4984-nad/ex_icmp.html), which has source code for ping. The text file output feature is left as an exercise for the reader 😉

Arjuna34

---

<div class="post-metadata">

**Author:** ![MinkMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/minkman/32/19170_2.png) [@MinkMan](https://boards.straightdope.com/u/MinkMan)\
**Post date:** [January 19, 2001, 2:31am UTC](https://boards.straightdope.com/t/c-plus-plus-question/50780/3 "2001-01-19T02:31:01Z")

</div>

As Arjuna34 pointed out, sure it’s possible in c++, but is there any particular reason you want to do in in c++? It would be significantly easier to do it a language like perl. What OS are you using anyway? Is this part of a larger project, or do you just want to keep track of a Quake server somewhere? If your using unix or a varient, it can be done in one line of code. Let us know a bit more about what you’re trying to accomplish, and perhaps we can be of more help.
