Master converting between hex, binary and decimal in your head with this game: play.google.co... Follow more CS videos @ hackercs.com
Пікірлер: 21
@proggenius20245 ай бұрын
thanks, please do more. We need more advanced c series
@benjahnz5 жыл бұрын
Great concise tutorial with clear examples. Nice work buddy!
@MakeItStik4 жыл бұрын
Great explanation. Thank you so much. Please continue making such videos.
@bhavyakukkar3 жыл бұрын
why was the 'extern' keyword not required while declaring the print_num( ) function in the caller file?
@esijal2 жыл бұрын
Very nice 👍
@santosharyan8849 жыл бұрын
thanks for ur great teaching,is this program give same result in turbo c,i dont think so,where r your other video s i want explaination abt global variables,
@shubhac49704 жыл бұрын
If there is a global static var x in file1.c and file2.c. How do we map the var in the .bss segment to that particular file?
@ulysses_grant6 жыл бұрын
Amazing job man. Thanks so much.
@aadil60818 жыл бұрын
great tutorial on "static" keyword,
@DragonSolidSnakeNY11 жыл бұрын
when would you need to use static on a function level to limit the scope? I've used static as a life extender for a variable before but never used it on a function in C. I used static in java on a function level but that just affects how you call it, I think.Also thanks so much for your videos you got me through my C++ and data structures course!.
@ricardoperez75808 жыл бұрын
quite clear tutorial, thanks so much
@iDROIDchannel4 жыл бұрын
I know that a lot of time gone... But why don't you marked the print_num() prototype as 'extern' in caller.c?
@bhavyakukkar3 жыл бұрын
i have the same doubt
@rustycherkas82292 жыл бұрын
Short answer: All vars declared (and thereby defined) outside funcs() are "globally visible" by default. 'Extern' was needed with 'int x;' (in this poor 'lesson') to DECLARE to the compiler that the LINKER will (should) find 'x' DEFINED (space allocated) somewhere in a related OBJ... Function prototypes are not function DECLARATIONS; they are simply 'promises' for the compiler to check parameters and return types. One could prototype a function "void foobar( int, float*, (char*)(int, int), int**);" and then never get around to writing the actual code for it... Just don't try to call it! Putting 'extern int x;' or the function prototype into caller.c is HORRIBLE practice. The compiler will not be able to confirm the func's parameters and return type (its "function signature") are correct. Likewise, 'x' may be declared an 'char *' in main.c, and 'float *' in caller.c... Good luck!! The compiler is helpless. This is why #include "foobar.h"; (header files) must be used to declare common (global) variables and functions. It is also why some version of "makefile" should be used for the compiler to know what OBJs and EXEs are stale after one or more source files has been altered. CAUTION: Do not declare static vars or static funcs in a header file (unless you know what you're doing). Each OBJ would otherwise receive its own private instance of declared variables... A better (minimal) example: FOO.h #include extern int x; // prototype declaring there exists a variable named 'x' and that its type is 'int' void print_num(void); // prototype declaring there (may) exist a function (taking no params and returning nothing) void caller(void); // another function prototype DATASPACE.c #include "foo.h" // For compiler to 'see' and check that 'x' is a well-known integer data type... int x = 0; // definition of variable. (space allocated) CALLER.c #include "foo.h" // For compiler to 'see' there exists an 'x' and a 'print_num()' to link void caller(void) { print_num(); x = x + 1; } MAIN.c #include "foo.h" // For compiler to 'see' there exists an 'x' and what 'caller()' looks like... void print_num(void) { printf("%d ", x ); } int main(void) { caller(); // Will print "0" caller(); // Will print "1" }
@shahriarshahabuddin59087 жыл бұрын
Very nice tutorial.
@battleroundscool9 жыл бұрын
excellent
@MrShubhambindal10 жыл бұрын
Very helpful. Can u tell me the software u r using for compilation
@tb66189 жыл бұрын
he is using gcc... Its in code blocks for windows and in Linux . The Os he is using for this is Linux.
@thangbanben56837 жыл бұрын
Tatrasiel R i have been using C to program microcontrollers. I didn't know we can compile code right from pc using gcc. Looks so convenient. Thanks :)