Question: Code in c language Note 1. Use of arrays is not allowed for the lab assignment instead start with an integer pointer and use malloc
Note 1. Use of arrays is not allowed for the lab assignment instead start with an integer pointer and use malloc function to allocate only the required amount of memory. Use POINTER NOTATION AND POINTER ARITHMETIC only to implement the assignment. 2. Description The lab 10 is on malloc and strings Implement the following functions for the lab assignment. int main0: Declares a new string (char pointer), then calls getString and prints the string with the size out. Then, main generates a random number between 1-25, and uses it to call cipherString. printing out the ciphered string. After which, it prompts the user to enter in how much the string was shifted, and uses cipherString with the negative user shift and prints out that string (the original string shifted right by the random number then shifted left by the user input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
