Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt,...
Transcript of Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt,...
![Page 1: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/1.jpg)
mith College
Computer Science
Dominique Thiébaut [email protected]
CSC231Week 13— Introduction to C
Fall 2019
![Page 2: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/2.jpg)
Complete the code
shown here
Computer Science Dominique Thiebaut
getcopy C/decrementArray.c
Exercise
![Page 3: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/3.jpg)
Complete the code
shown here
Computer Science Dominique Thiebaut
Solution
![Page 4: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/4.jpg)
Exercise
Computer Science Dominique Thiebaut
• Write a C program that uses functions to find the largest integer in A. The result is passed back using a return statement.
![Page 5: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/5.jpg)
Solutiongetcopy C/findMaxUsingFunctionSol.c
Computer Science Dominique Thiebaut
![Page 6: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/6.jpg)
Exercise
• Write another program that does the same thing but the max is passed back by reference.
Computer Science Dominique Thiebaut
![Page 7: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/7.jpg)
Solutiongetcopy C/findMaxUsingFunction2sol.c
Computer Science Dominique Thiebaut
![Page 8: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/8.jpg)
Input/OutputIO
![Page 9: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/9.jpg)
Input From User
Computer Science Dominique Thiebaut
![Page 10: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/10.jpg)
(cont’d)
a.outEnter your name, please: MickeyEnter your age: 21Enter your version of pi: 3.14159Mickey is 21 years old, and thinks pi is 3.1415901184
Computer Science Dominique Thiebaut
![Page 11: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/11.jpg)
Dynamic Variables
Computer Science Dominique Thiebaut
![Page 12: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/12.jpg)
• Dynamic: think "new" in Java
• malloc() = Memore Allocation for new data structure
Computer Science Dominique Thiebaut
![Page 13: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/13.jpg)
RAM
Computer Science Dominique Thiebaut
user
pro
g
malloc()
![Page 14: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/14.jpg)
user
pro
g
malloc()
RAM
Computer Science Dominique Thiebaut
OperatingSystem
![Page 15: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/15.jpg)
RAM
Computer Science Dominique Thiebaut
OperatingSystem
dyn
user
pro
g
malloc()
![Page 16: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/16.jpg)
RAM
Computer Science Dominique Thiebaut
OperatingSystem
dyn
(void*) p
user
pro
g
malloc()
![Page 17: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/17.jpg)
RAM
Computer Science Dominique Thiebaut
OperatingSystem
dyn
(void*) p
p
user
pro
g
malloc()
![Page 18: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/18.jpg)
Computer Science Dominique Thiebaut
getcopy C/malloc1.c
Malloc
![Page 19: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/19.jpg)
Exercise• Modify the previous program that computed the
max of an array, but this time you allocate the array dynamically, with numbers provided by the user.
Computer Science Dominique Thiebaut
![Page 20: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/20.jpg)
Solution
Computer Science Dominique Thiebaut
getcopy C/findMaxUsingFunction3sol.c
![Page 21: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/21.jpg)
sizeof()can be tricky…
Computer Science Dominique Thiebaut
![Page 22: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/22.jpg)
sizeof ()
Computer Science Dominique Thiebaut
![Page 23: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/23.jpg)
sizeof(A) = 20sizeof(A[0]) = 4sizeof(B) = 8sizeof(B[0]) = 4sizeof(p) = 8sizeof(*p) = 4sizeof(name) = 14strlen(name) = 13sizeof(a) = 4sizeof(x) = 4
sizeof ()
Computer Science Dominique Thiebaut
![Page 24: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/24.jpg)
sizeof(A) = 20sizeof(A[0]) = 4sizeof(B) = 8sizeof(B[0]) = 4sizeof(p) = 8sizeof(*p) = 4sizeof(name) = 14strlen(name) = 13sizeof(a) = 4sizeof(x) = 4
Different!
sizeof ()
Computer Science Dominique Thiebaut
![Page 25: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/25.jpg)
File IO
![Page 26: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/26.jpg)
File I/O: Output
Computer Science Dominique Thiebaut
C/fileIOOutput.c
![Page 27: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/27.jpg)
File I/O: Input
Computer Science Dominique Thiebaut
C/fileIOInput.c
![Page 28: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/28.jpg)
Computer Science Dominique Thiebaut
File I/O: Reading Ints [~handout] cat fileOfInts.txt 41 2 34 5 67 8 910 11 12
![Page 29: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/29.jpg)
Computer Science Dominique Thiebaut
File I/O: Reading Ints
C/fileIOReadNumbers.c
![Page 30: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/30.jpg)
Computer Science Dominique Thiebaut
[~handout] gcc fileIOReadNumbers.c[~handout] a.out1, 2, 34, 5, 67, 8, 910, 11, 12
File I/O: Reading Ints
![Page 31: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/31.jpg)
Exercise• Write a program that reads the file data.txt, which
has the number of ints it contains on the first line, then one int per line for the rest of the file. Your program must use a dynamic array to store the numbers, and find the max of the array, and print it.
Computer Science Dominique Thiebaut
![Page 32: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/32.jpg)
Function Prototypes
and Multi-File Projects
Computer Science Dominique Thiebaut
![Page 33: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/33.jpg)
Original
Computer Science Dominique Thiebaut
![Page 34: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/34.jpg)
myfuncs.c
smallestLargestSum3.c
Computer Science Dominique Thiebaut
myfuncs.h
![Page 35: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/35.jpg)
Computer Science Dominique Thiebaut
![Page 36: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/36.jpg)
Summary• C has a lot in common with Java
• C programmers must know how to use memory (malloc, pointers)
• No garbage collector: free dynamic structures yourself!
• Explicitly pass arguments by value or by reference to functions
Computer Science Dominique Thiebaut
![Page 37: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/37.jpg)
D. Thiebaut, Computer Science, Smith College
End of Video Lecturehttps://www.youtube.com/watch?v=LFpoUFIfV0M&a=youtu.be
![Page 38: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/38.jpg)
D. Thiebaut, Computer Science, Smith College
Logistics and Update
• Video lecture for Monday's snow day + Quiz
• No office hours today
• Office hours tomorrow (12/5) 12-1 p.m.
• Homework extended to 12/5 11:55 p.m.
• Homework 11 (optional) released tomorrow morning
![Page 39: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/39.jpg)
D. Thiebaut, Computer Science, Smith College
And now, something completely different…
Executablegcc addition.c
![Page 40: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/40.jpg)
D. Thiebaut, Computer Science, Smith College
And now, something completely different…
Executablegcc addition.c
gcc -S -m32 -masm=intel addition.c
![Page 41: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/41.jpg)
D. Thiebaut, Computer Science, Smith College
ReviewMalloc
![Page 42: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/42.jpg)
D. Thiebaut, Computer Science, Smith College
ReviewMalloc
![Page 43: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/43.jpg)
Linked-Listsin C
Computer Science Dominique Thiebaut
![Page 44: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/44.jpg)
D. Thiebaut, Computer Science, Smith College
Outline
• Linked Lists in C
• Structures in C
• Creating a Node
• Adding a Node
• Removing a Node
‘Alpha’
‘Zero’
‘Beta’
‘Apple’
head
![Page 45: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/45.jpg)
"Alpha"
"Zero"
"Beta"
"Apple"
head
Computer Science Dominique Thiebaut
![Page 46: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/46.jpg)
Computer Science Dominique Thiebaut
NULL
((void *)0)
"Alpha"
"Zero"
"Beta"
"Apple"
head
![Page 47: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/47.jpg)
The Node in C"Alpha"
Computer Science Dominique Thiebaut
http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Structures
![Page 48: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/48.jpg)
C Structs
• Early attempt at encapsulating data
• Members are accessed using the dot notation:
http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Structures
Computer Science Dominique Thiebaut
![Page 49: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/49.jpg)
Struct Example
Computer Science Dominique Thiebaut
![Page 50: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/50.jpg)
Struct Example
Computer Science Dominique Thiebaut
![Page 51: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/51.jpg)
Struct Example
Computer Science Dominique Thiebaut
getcopy C/structExample.c
![Page 52: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/52.jpg)
The Head of the List
Computer Science Dominique Thiebaut
head
![Page 53: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/53.jpg)
The Head of the List
Computer Science Dominique Thiebaut
head
That’s anempty list!
![Page 54: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/54.jpg)
Displaying the List
Computer Science Dominique Thiebaut
"Alpha" "Zero" "Apple"
head
"Beta"
![Page 55: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/55.jpg)
Creating the List
Computer Science Dominique Thiebaut
"Apple"
head
"Beta"
![Page 56: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/56.jpg)
Computer Science Dominique Thiebaut
![Page 57: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/57.jpg)
Computer Science Dominique Thiebaut
![Page 58: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/58.jpg)
Computer Science Dominique Thiebaut
getcopy C/linkedListStrings.c
![Page 59: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/59.jpg)
Exercise
• Add code to the linkedListStrings.c program that will remove all the nodes from the list, one by one (and free them).
• Make your code display the list after each deletion
Computer Science Dominique Thiebaut
![Page 60: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/60.jpg)
Exercise
• Use functions for adding and removing nodes…
Computer Science Dominique Thiebaut
Main ProgramCalling
Functions
![Page 61: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/61.jpg)
Solution
Computer Science Dominique Thiebaut
getcopy C/linkedListStrings2.c
![Page 62: Week13 - Home - Clark Science CenterExercise • Write a program that reads the file data.txt, which has the number of ints it contains on the first line, then one int per line for](https://reader034.fdocuments.us/reader034/viewer/2022050402/5f80242943210c7cf92ae35b/html5/thumbnails/62.jpg)
D. Thiebaut, Computer Science, Smith College
We stopped herelast time!