Sunday, May 10, 2015

edX: - HarvardX: CS50x3 Introduction to Computer Science - week 3

Main functions, command line arguments and sorting  are covered . There are some fun examples of sorting here.







main with argv[] - array of strings
2 chunks of memory


./hello-3 Zamyla     with argv[1]
if no name  - null
argv[5000]  - segmentation fault - touched segment of memory we should not have

error checking   - argc==2
any number of arguments beside 2, program will exit

string - array of char
argv-1      This will print each argument, one per line 
argv-2    get the jth char in the string

sorting- bubble sort, selection sort, insertion sort




Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

No comments:

Post a Comment