thanks, please do more. We need more advanced c series
@proggenius20247 ай бұрын
please do more, very good content!
@Livy29648 ай бұрын
it is the only one video that i found about this! thank you so much ahahah first comment :)
@theblackelephant Жыл бұрын
please f your watching this video in 2022 up this method of static making a variable accessible global is bull shit
@grimvian Жыл бұрын
Very rare and fantastic video explaining from documentation. I really hope he would make videos about advanced C... At 9.52 Almost the way I use a union to change RBG colors for my C training.
@abhishekgupta-du1ly Жыл бұрын
It very really helpful for me 😊
@grimvian Жыл бұрын
No unrelevant music or fancy video editing, but pure and clean explaining/teaching! HackerCS's videos are absolute gems!
@ratfuk9340 Жыл бұрын
What if the caller doesn't know the size in advance? Is it then better to allocate memory in the called function or should the caller just guess and then the callee realloc if necessary? That seems like a bad idea.
@rpnightwolf Жыл бұрын
Your math puts you at 23:59:59 hours a second short of 24 hours 23 times is the correct answer.
@esijal2 жыл бұрын
Very nice 👍
@MakeItStik2 жыл бұрын
Hey HackerCS , good to see you are back. That was so long! Just a suggestion, the way you used to make your earlier videos where you used to explain what the problem is and what we are trying to achieve by scribbling over the page using pen tablet (maybe) was your USP. Please use the same technique, it will connect better with audience.
@ramakrishna40922 жыл бұрын
@@HackerCSVideos hey good to see back I have a doubt what is sizeof NULL in c can you tell me what is actually means
@rustycherkas82293 жыл бұрын
A great use of a union is dealing with arrays as named values and also as indexed arrays: union { struct { int monHrs, tueHrs, wedHrs, thuHrs, friHrs; } wk; int hrs[5]; } data; Code can then clearly refer to the specific "data.wk.thuHrs", for example, OR it can, for instance, sum all values: for( int i = 0; i < sizeof(data)/sizeof(int); i++) total += data.hrs[ i ]; Of course, #define'd index names (or enum tokens) would work the same, but one gets tired of seeing "v[ INDEXNAME ] = 12;" vs "u.v.realname = 12"...
@DrOggy673 жыл бұрын
Excellent video... Thanks a lot for explanations!
@umarjanbhat38193 жыл бұрын
It will print the result in reverse order ...change the order of printf and recursive call
@manasverma68713 жыл бұрын
Thanks buddy 😀😀😀😀😀😀
@matejkvassay79933 жыл бұрын
great explanation, thanks :)
@seydoudia78283 жыл бұрын
Brilliant! Thank you!
@siyanibillinumberone40543 жыл бұрын
How about two dimensional array For example Name and age total 10 rows and 2 elements per row is name and age
@coderhub48063 жыл бұрын
I'm watching this video and this is still one of the best videos
@michealking64253 жыл бұрын
I like your lyrical flow. You should reduce the number of times you write on the screen for it would greatly increase readability. Otherwise, c'est magnifique
@fightbreastcancerwot70733 жыл бұрын
Nice video. Just would make sure to note that combinations != subsets. This problem should have asked for all the sunsets of a string, instead of asking for combinations.
@Fakipo3 жыл бұрын
Wow, you made my day. Great video.
@raamnaath3 жыл бұрын
KZbin Recommends me after 8 Years🔥😀
@ayeshach79683 жыл бұрын
The simplified form of last step T=T/12+N N=T- T/12 N=24-24/12 N=24-2=22
@vishnukartha473 жыл бұрын
Hi in the 4th solution, that char pointer is not declared static, so that will be stored in the stack right, if so returning that make no sense, since after the use of that function this memory will be cleared and the return will be garbage. Am I correct? Please make a reply
@MakeItStik3 жыл бұрын
Which software are you using to draw ?
@bhavyakukkar3 жыл бұрын
why was the 'extern' keyword not required while declaring the print_num( ) function in the caller file?
@michaelotu97233 жыл бұрын
I watched and I was interested. do you have a C programming course?
@johnny14833 жыл бұрын
In one hour the minute hand goes 60 spaces. The hour hand goes 5 spaces. They go at constant rates. For any given time period, the minute hand moves 12 times as many minute spaces as the hour hand. In 12 mins the hour hand goes 1 space, and the minute hand goes 12 spaces. So the gain every 12 mins is 11 spaces. A space is gained every 12/11 minutes. 60 spaces gained in 12/11 hours.. So they meet once every 12/11 hrs. They meet 11 times every 12 hours, and 22 times every 24 hours. Nice solution. Just wanted to present an arithmetic one.
@saifaldeenal74514 жыл бұрын
The best explaining, Thanks
@saifaldeenal74514 жыл бұрын
The best ever found online. Thank you!
@rallokkcaz4 жыл бұрын
@4:25 you could also define your return type as const which can hint the compiler to figure out stack/heap/bss storage. From my experience only pass const buffers unless the messages are mutable.
@crptc57074 жыл бұрын
I literally gave up learning C after being muddled by the declaration nonsense... until I watched your video! Much appreciated!
@excessreactant90454 жыл бұрын
Very clear vid. 10/10
@xeniakaragianni81004 жыл бұрын
thanks ♥
@mikaarnald73614 жыл бұрын
Awesome. Thanks!
@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
@rustycherkas82293 жыл бұрын
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 <stdio.h> 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" }
@33galactus4 жыл бұрын
If n is negative, just make following changes: n = -n and x = 1/x.
@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?
@vimukthimadhusanka48064 жыл бұрын
fantastic explanation! keep it up
@isambenelmekroud34244 жыл бұрын
carry= (a[i]+b[i]-r[i])/10
@David-gu8hv4 жыл бұрын
You have to watch out for the size of Structs. If you have a struct with one char and one int on a 32-bit system the struct will be 8 bytes since the smallest amount of memory on 32-bits is 4 bytes. The char will claim 4 bytes even though it only uses 1.
@stephaniepetrone2604 жыл бұрын
get a decent microphone
@Rahulkumar-dg5pu4 жыл бұрын
Great video cleared my doubt Thanks!!
@MakeItStik4 жыл бұрын
Great explanation. Thank you so much. Please continue making such videos.
@jackmanjls4 жыл бұрын
Excellent presentation, both videos were very informative.