goto Statements | C Programming Tutorial

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I'm using quite a bit of dynamic memory in heap, and i was thinking of using goto for the purpose of minimizing code duploication when handeling errors and still manage to clean up my memory correctly even when encountering errors.
Is that a valid usecase for the goto statement or should i do something else?

stianpedersen
Автор

Can we make go to conditional: for example will it be valid : if k=1 go to there

tapaskumarbhattacharya
Автор

I would say extract the loops in a function and then return if k equals 5?

richardkok
Автор

should all goto labels be at the end of the code? and is it possible to have a label in a block similar to functions?

joanescamilla
Автор

I came to the 73rd lesson and there are more lessons

Sanjar-td
welcome to shbcf.ru