[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: char *test[position]



> 
> 	unsigned int position= 0;
> 	char *test;
> 	printf ("%s", test[position]);
> 
> But the programm prints the complete string down to [position] .


It depends on what you want to print. If you want to print the string from
[position] on, use 'test + position' or &( test[position] ). If you want to
print the position-th character of the string, use %c instead of %s. (to the
format-string functions like printf or scanf and others, %s means string and
%c is a character).


I hope this will help you.



Tomas Andrle / red_hatred
tomaasz@penguinpowered.com