Question: Please use program C Thank you! Question 1: Pointers of Pointers Write a function, named ptr_to_ptr, that returns an int and takes three arguments: An
Please use program C Thank you!
Question 1: Pointers of Pointers
Write a function, named "ptr_to_ptr", that returns an int and takes three arguments:
An int called "a".
A pointer to an int called "b".
A pointer to a pointer to an int called "c".
Return the value of "a", store the value of a + 1 in the address indicated by "b" and store the value of a + 2 in the address indicated by the pointer's address of "c".
Question 2: Shorten The String
Write a function, named "truncate", that shortens a string to only have 3 non-null characters in it. The function only has a single argument, a character pointer/array. You can assume the string's size is 4 or greater.
Example usage:
char string[] = "Hello World";
truncate(string);
printf("%s ", string); // Should print Hel
Question 3: Count Bangs
Write a function, named count_bangs, that takes a single argument, a string (char pointer/array), and returns an int of the number of bangs (exclamation points (!)), in the string.
Question 4: Convert Single Quotes to Double Quotes
Write a function, named "convert", that takes a single argument, a string (char pointer/array). The function should modify the string so that all single quote characters are replaced with double quotes.
Question 5: Mixing strings
Write a program that reads in two whitespace separated strings from stdin. First your program should output the two strings it read in. Then, your program should output two letters from each string until there are no more letters in either input string. Neither input string will be longer than 10 characters.
Example input:
abcde 123456789
Correct Output:
String 1 = abcde
String 2 = 123456789
Mixed = ab12cd34e56789
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
