Is there any function for printing a string up to space,
e.g.
char* A = "This is a string."
print(A+5);
output: is
I don’t want printing character by character.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
printf("%s", buf)prints the characters frombufuntil a null terminator is encountered: there is no way to change that behaviour.A possible solution that does not print character-by-character, does not modify the string to be printed and uses the format specifier
%.*swhich prints the firstNcharacters from a string:Output: