I am unable to interpret the reason behind the answer of following question::
can u plesae help me??
void main()
{
printf(5+"good morning");
}
output::::
morning
I am unable to interpret the reason behind the answer of following question::
can u plesae help me??
void main()
{
printf(5+"good morning");
}
output::::
morning
Look into pointer arithmetic.
I'm trying to make the algorhtym and C language to find the first word of a string which the word is limited by a space
any idea?
Welcome to the forum, Rahulshrirs and Theo!
The strtok() function (include string.h for string functions), is made for this. It's a bit complicated, because on your FIRST call to strtok(), you need to include the name of the string (or a pointer to it's address). However, on subsequent calls, you replace that name, with NULL, and that tells the strtok() function to continue from where it left off, in the same char array. You need that so it works easily with loops.
I'm sure if you search the forum for strtok(), you'll find many examples (the FAQ should have something, as well).
Let us know if you get stumped, but give it a good go.