troubleshooting Question

urgent - pointers to pointers

Avatar of zizi21
zizi21 asked on
10 Comments2 Solutions279 ViewsLast Modified:

could anyone pls help?

i dont know what is it.

char **str;

str= calloc(5,sizeof(char*));

so that i could have like this

str[0] point to hello (token from file)
str[1] point to world

for testing purpose  i did,
printf("Str 0 is %s",str[0]); and i got world instead of hello..

but when i try to access the str[0] at the end of the program, i get junk..could anyone pls help
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 10 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 2 Answers and 10 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