Thursday, 15 July 2010

Pointers in c (how to point to the first char in a string with a pointer pointing somewhere else in the same string) -


If I have an indicator that is pointing somewhere in a string, then we say that it points to the third letter (We know the letter position, basically we do not know that it is the third letter), and we want to point it back to the first letter so that we can tap the string, how do we do it?

> For example:

If we have ascii as an indicator in the ascii string Somewhere pointing out, and how do I do it?

(Note: I tried to say that

  int len ​​= strlen (ascii); ascii - = Len; ascii = '0';  

but this is not working, this is where the indicator is, but not the first letter of 0)

You can not have C and C ++" no hidden costs "rule, which means, except for other things, no one else secretly introduces your strings to you Is going to launch. Another common thing is the array size; You have to store them yourself too.


No comments:

Post a Comment