Write code to define a function as follows: 1. function is named foo 2. foo takes a pointer to a character and returns an integer named x. 3. foo uses the pointer to check what it’s pointing to, if it is a character terminator, the functions returns an integer named x. 4. If not, foo counts by 1 if a call to an assumed function named, check1 returns 1. check1 requires one character argument and returns 0 or 1. You do not need to write the definition of check1; assume it’s already defined. 5. make sure to advance the pointer to the next character unless the terminator is found. C PROGRAM with prinf and scanf
Expert Answer
#include<stdio.h>
#include<string.h>
char check1(char chck);
int foo(char *p){
Don't use plagiarized sources. Get Your Custom Essay on
Answered! Write code to define a function as follows: 1. function is named foo 2. foo takes a pointer to a character and returns…
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
int x=0, count = 1, i;
char c;
if(*p == ‘