Stack Overflow Errors | C Programming Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Thanks for bringing new C videos and not have music or other fancy gimmics.

In your example you said that the segmentation fault, was a result of stack overflow. I hope one day the C language will implement better error messages in general.

We all have a preferred learning style and teachers have thoughts about, how to educate or to teach - I hope.
You are one of the C-teachers, I follow, but for me pedagogically, it would be much better with less scrolling.

I know that the places of curly braces is a personal preference, but after starting to learn C, I ended up with this way of formatting my code. I have strange kind of dyslexia and this format is the best for me and I can have more lines on the screen.

int sum(int a[], int length, int i) {
if (i == length) {
int dummy = 0; // just to add a line for using curly braces
return 0;
} else
return a[i] + sum(a, length, i + 1);
}

grimvian
Автор

Thank you. 😊 looking forward to your tail recursion video.

edenng
Автор

Great explanation and examples. Thanks very much for making this!

bencepaul
Автор

Was that array of 1 million elements not supposed to cause a stack overflow by itself ? I thought with a stack of 1MB, and an array of 1 million elements, that there would not be enough memory on the stack to accommodate such a large array.

roualdeetlefs
Автор

thank you so much. Excellent explanation !!

Besides iterative methods and recursive methods, are there other mechanisms we should be aware of ?

alvarobarboza
welcome to shbcf.ru