CS221: C and Systems Programming Fall 2019

computer science

Description

CS221: C and Systems Programming Fall 2019 - Lab 11.2 Part II Date: October 31, 2019 1. Identify all the problems with this code. If nothing is wrong, state NONE. int * foo ( int n ) { int * ptr = malloc ( sizeof ( int )); * ptr = 3; ptr = & n ; return ptr ; } int main ( void ) { *( foo (5)) = 10; return 0; } 2. Write a recursive function that checks if a string contains the letters ‘A’ or ‘B’(or both). You may assume the string passed to the function only contains uppercase letters. bool containsLettersAB ( char * str ) {


Related Questions in computer science category