char *p = " woohoo";
int condition = /* some calculation applied to p */
/* to look for all 0x20/blanks/spaces only */
if (condition)
{
}
else
{
printf("not ");
}
printf("all spaces\n");
One-liner:
int condition = strspn(p, " ") == strlen(p);
Slightly more optimized:
int condition = p[strspn(p, " ")] == '\0';