CSC209H5 Lecture Notes - Lecture 3: Segmentation Fault, Gnu Compiler Collection

62 views2 pages

Document Summary

Csc209h5s - software programming and tools (winter 2018) Lecture 3: arrays, pointers and arguments (jan 22, 2018) Notes by jonathan ho: each example below contains an independent code fragment. In each case there are variables x and y that are missing declaration statements. In the boxes to the right of the code write declaration statements so that the code fragment would compile and run without warnings or errors. Declaration for y int int * char int ** pointer of pointer double ** double ** *p = address of f (float) x = address of p (float *) float ** f = 4. 5 (float) p float * x float ** y 4. 5 (float) y = x(x+0) Fix the program by changing the signature of the function to use a pointer. Void lie( int age) { printf( "you are %d years old\n" , age); age += 1 ; printf( "you are %d years old\n" , age); int main() {

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents