troubleshooting Question

Urgent!! Converting string of chars to char *; char[512] to char *

Avatar of indianneo
indianneo asked on
21 Comments1 Solution724 ViewsLast Modified:
Hi there, I need help on this immediatley in couple of hours. Pls
I m stuck on this..
I have ..

char buf[512];
char *mybuf;

  I get input(suppose from a client process in buf
  then use getipnodebyname(buf, .....); to get the ip of the hostname in buf

Since getipnodebyname is defined as getipnodebyname(const char *name,....)
I cannot use buf directly in place of the *name above. I need to convert it to   char *
 If I hard code the hostname to *mybuf = {""} and use mybuf it works fine ... but I want the client to insert the hostname ... and I cannot change the buf variable to anything else... that is my restriction.

Any help on converting a string of char to a char* will be appreciated ... My clock is counting down ...pls help.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 21 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros