All Questions
5 questions
2
votes
4
answers
4k
views
When was block scope for variables introduced to C, and why is it still frowned upon?
In light of the recent OBJ_obj2txt vulnerability in LibreSSL (which was found during the OpenSMTPD audit, and does not affect OpenSSL), it came to my attention that the memory leak issue likely ...
8
votes
5
answers
468
views
How to make it obvious that a function is being accessed from the outside?
This is a C specific question. I am trying to keep everything possible inside the translation unit boundaries, exposing only a few functions through the .h file. That is, I am giving static linkage to ...
3
votes
2
answers
467
views
How to pass parameters to a function in C
Suppose I'm writing a program in C in which several parameters are asked at the beginning of the execution to the user and then remain costant until the end. Now, I need to pass these parameters to ...
4
votes
9
answers
5k
views
Confusion of scope of a variable: Is Global Variable a solution? [duplicate]
I am newly learning C Programming.
When we have a C Program with lot of functions, parameter passing, calling and all - It becomes a great problem as to which variable must be declared where.
My ...
5
votes
1
answer
482
views
Scoping recommendations while developing in C
While developing a library using C, what are your recommendations about variable and function scoping?
In C++, OOP and namespaces made the whole thing a lot easier. But how to do that with plain C? ...