Professional Documents
Culture Documents
1-Structures and Pointers Internship Test
1-Structures and Pointers Internship Test
Instructions
Note!
Hints
Output Expected
Submission
Instructions:-
- You must edit the sample.c file provided to you such that it
achieves the expected output. (details given in the lower
portion of the document)
NOTE!
● you can make `f1`, `f2` and `f3` point to any
functions(library OR user-defined) you deem convenient but
they MUST be executed as function pointers and not called by
function identifiers.
● you may allocate memory on the heap as you see fit using
`malloc()` but before the main function exits, all the heap
allocated memory must be freed(using `free()`) and there
should be no memory leaks. Valgrind is a tool that can help
you check for memory leaks.
Hints
● Capitalized alphabets have their ASCII values 32 less than
the values of their lowercase counterparts.
● Useful functions:-
This document is Private and Confidential.
Seashore Technologies Pte. Ltd.
4
a. - malloc
b. - strlen
c. - strcpy
d. - realloc
e. - strcat
f. - isalpha
g. - islower
h. - toupper
i. - free
Output Expected
Your program must compile without any errors and warnings and it
must not contain any memory leaks.
Note that the first block in the output is printed by the `main`
function while the second block by the `helper` function in
accordance with the instructions provided in the document.
Submission
● Create a file named Author and list your email ID in the first line of the file followed by a
‘\n’.
● Your final directory must look like this:-