Example for passing pointers to function in c:
What does below function do?
void strfun(char *dst, const char *src)
It is copying the contents of src string to dst string.
it is an example of infinite loop. Each time when it is entering while loop, it is comparing for equality of the characters of both the pointers, which will never end.
it copies the first character of src to first character of dst.
while loop can't have a semicolon. it gives compile time error.
Back To Top