C Programming: Common Mistakes, GCC version
Автор: Darin Brezeale
Загружено: 2020-08-10
Просмотров: 2330
I go through 14 mistakes that I have found to be common among new C programmers. In this video, I demonstrate using GCC so the error messages are specific to it, but these things are mistakes no matter what compiler you use. A version of this video can also be found on my website at https://www.brezeale.com/?p=722
This video is part of my C Programming Playlist: • Introduction to Programming using C If you are teaching yourself to program, I have put together a guide at https://www.brezeale.com/?p=427
@0:39 Mistake 1: not declaring variables at the top of a block in C89 generates
"warning: ISO C90 forbids mixed declarations and code"
@1:50 Mistake 2: syntax: using // as a comment style in C89
generates "error: C++ style comments are not allowed in ISO C90"
@2:28 Mistake 3: logic error: get weird values due to uninitialized values
@4:15 Mistake 4: logic error: using = instead of ==
@6:00 Mistake 5: syntax: not indicating how much space to allocate
generates "error: array size missing"
@7:10 Mistake 6: logic error: changing passed variables from a function
@8:42 Mistake 7: logic error: changing passed pointer from function
generates "warning: assignment makes pointer from integer without a cast "
@10:35 Mistake 8: logic error: using sizeof in function
generates "warning: ‘sizeof’ on array function parameter ‘d’ will return size of ‘int *’"
@13:05 Mistake 9: runtime: char* s; versus char s[20]; changing s[0]
generates "Segmentation fault"
@16:35 Mistake 10: runtime: passing incorrect values to strcmp()
generates "expected ‘const char *’ but argument is of type ‘int’"
@19:30 Mistake 11: logic error: attempting to increment a value being pointed to with *ptr++
@22:10 Mistake 12: runtime: char* a; versus char a[20]; memory storage
generates "Segmentation fault"
@24:10 Mistake 13: logic error: losing an address in a pointer
@27:34 Mistake 14: logic error: storing an address versus what is at the address
#tutorial #Cprogramming #C_programming

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: