Code:
void
/*
* Return nothing
*/
rawr
/*
* A foolishly named function name.
*/
(
/*
* The beginning of your parameter list.
*/
const
/*
* const is like a hot 16 year old. Look but don't touch.
* You are promising the caller that you will never
* change the contents of something, but you are going
* to look at it.
*/
char *
/*
* This is a pointer to a character sized block of data
*/
st1
/*
* This is the name of the variable.
*/
)
/*
* This denotes the end of your parameter list.
*/
{
/*
* Begin your function definition.
*/
/* Ok, so here is the part that is confusing you the most.
*
* You want to start with the string as it is now. So do NOT put
* st1 = 0; That is just plan wrong.
*
* You will move the pointer up one address each time you loop. Which will
* result in "the next letter" being pointed to.
*
* The loop exists once you reach a '\0' character.
*/
for(;*st1 != '\0';st1++) /* I changed the condition to make it clearer for you */
printf("%s\n", st1);
}
/*
* End your function definition.
*/