How can I change this line of code into pointer arithmetic?
for (k=strlen(t)-1; k>=0; k--)
And can I use this line in a pointer arithmetic version or do i need to modify it as well?
sscanf(t,"%s", &line);
How can I change this line of code into pointer arithmetic?
for (k=strlen(t)-1; k>=0; k--)
And can I use this line in a pointer arithmetic version or do i need to modify it as well?
sscanf(t,"%s", &line);
Could you please clarify on what it is you would like to do.
Yeah. You definately want to be more specific. What are you trying to use pointer arithmatic for in your example? The only pointer I see there is t, and all you're doing there is finding out how long it is.
Other than that, you're just counting down...
Is that enough pointer notation for you?Code:int w,*x,y,*z; char *t = "wheeeeeeeeeeeeeeeeeeee"; for( w=strlen(t),x=&w,y=0,z=&y;(t+*x)!=(t+*z);*x-- )
Quzah.
Hope is the first step on the road to disappointment.
>for (k=strlen(t)-1; k>=0; k--)
This is obviously traversing a string from the end to the front. So it would be something like this:
>sscanf(t,"%s", &line);Code:char *astr = "Some string"; char *k; for ( k = &astr[strlen(astr)-1]; k >= astr; k-- )
Be more specific.
-Prelude
My best code is written with the delete key.