Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
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: 20
Guests Online: 16
Members Online: 4

Registered Members: 82891
Newest Member: C0nQU3r0R
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Variable problem in C++


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-08-06 18:20
Hi!

How do i do if I want to give a variable a value consisting of some text and a variable?
Like

string hello, ip = 127.0.0.1;
hello = "PING "+ip;

Or if I want to run the system command with both text and a variable like

string ip = 127.0.0.1;
system("PING"+ip);

Sry if I wrote something wrong, I'm kinda new to this... Please help me Smile

Thx


Author

RE: Variable problem in C++

alfredwolf
Member

Your avatar

Posts: 15
Location:
Joined: 23.06.06
Rank:
Guest
Posted on 29-08-06 19:22
you could use the system commands like

system(ping 127.0.0.0);
and loop it if your trying to attempt a ping of death.

or

#include <iostream>

int main()
{
int counter;
std::cout << "How many times to ping?: ";
std::cin >> counter;
while (counter > 0)
{
system("Ping 127.0.0.0"Wink;
counter--;
}
std::cout << "you pinged: " << counter << "\n";
system("PAUSE"Wink;
return 0;
}

of couse where the ip = 127.0.0.0 you might wanna change to the one your pinging






Author

RE: Variable problem in C++

Uber0n
Member



Posts: 1963
Location: Sweden‭‮
Joined: 13.06.06
Rank:
Hacker Level 3
Posted on 29-08-06 19:26
I think that was just an example... Is there a way to combine a text string and a variable and turn it into a new variable?

Not just using PING... But in general :right:


img230.imageshack.us/img230/724/uber0nsig3hj6.gif
http://uber0n.web. . .
Nope http://uber0n.webs.com/
Author

RE: Variable problem in C++

alfredwolf
Member

Your avatar

Posts: 15
Location:
Joined: 23.06.06
Rank:
Guest
Posted on 29-08-06 19:27
yeah... but i havent done much of that you'll wanna check out polymorphisim or something else...... just a though.