Комментарии:
careful with realloc, this might cause memory leak if realloc failed. if realloc fails it returns null so now you lost a reference to the older pointer if you do p = realloc(p, newsize).
ОтветитьJacob, thank You for this and for other videos.
ОтветитьСупер
Ответитьwhen you use realloc, the old 15 integers are deleted and the system allocate 20 new integers somewhere in the memory space
Ответитьwhy we cann't assign array for an other array directly?
ОтветитьHow would I go about creating a large array that uses the input and a loop to initialize the variables, while not having to initiialize my entire array.
For example: My array can contain 30 integers, but at some point I decide to only initialize 10 of them. How can I do this without having to just change the size of my array.
The fact that for every single topic you say "if you are confused, I have a video on that" shows how good and complete your content is. Great job.
ОтветитьJacob, thank you for your insightful videos. I’m not certain, but I think we are both members of the same church (I can sorta just tell).
Could you make a video covering how variable-length arrays can be unsafe because they can overrun the stack? Also, it might be good to point out that the compiler will need to use dynamic sizing of stack frames rather than static sizing if you use VLAs, which can lead to some performance issues under some rare circumstances.
Great content! Thanks
ОтветитьI was hoping you would talk about 2d variable length arrays. I'm having a hard time initializing and using them, specifically a 2d VLA of structs.
Ответить...And I'll C/C++ you then.
ОтветитьOne of the reasons not to mix new/free and *alloc/delete is because of class/struct constructors/destructors. If you have an array of, or a single of, any intrinsic type, it would likely work, but still do <b>not</b> do it.
ОтветитьArrays? No thanks. I prefer a raise (I don't get paid enough
ОтветитьI'm a begginer in C/C++, can someone explain me how to resize an array/pointer size at run time? E.g. I create an char array/pointer with size 10 and I ask the user their name, let say their answer is bigger than 10, how can I avoid an error/overflow?
ОтветитьI have a question:
For example I have a struct named Student and declare: struct Student student[100]; (or *student[100]?)
Can I have different sizes for: char student[0].name[?] ?
Essentially I want to have a larger array, if the students name is longer. Is this possible? Or do I just have to find the maximum length and then waste some space?
So glad I found your channel. Clear and understandable English, no blaring music in the background, or the opposite (like watching a silent movie in
super-speed...lol 😁). Very instructional, informative and engaging to say the least! Kudos! Thanks for the awesome work you put into such a great channel.
What IDE/environment is this?
ОтветитьWhat is differential between C11 and C99?
Ответитьcan you please talk about 2d arrays ? from a C programmer prospective ( including pointers , addresses .. )
ОтветитьPlz plz answer this question sir..
For passing multidimentional array to function how valid is to use
void function(int x, int y, int array[x][y]);
This worked fine on my system.
I am himanshu sharma from india
how to return dynamic arrays from functions in C? (no resources found for this) (beginner programmer in C here...)
ОтветитьGood stuff, thank you! Subscribed. I find that if I feel like doing some low level stuff, C fits my style much better than C++. It's simple and to the point. Modern c++ is so cumbersome and it puts me off. Otherwise, I'm happy with C#(-:
ОтветитьLoved it. I would love to learn compiler/interpreter design. May be create scripting language for my programs in C using C. I just love the way you try things in C. I am enjoying it :)
ОтветитьYour videos provide a lot of clear information. I've learnt a lot from your content. It's really amazing.
Thank You so much.
Is c++ relevant for embedded system programming on small controllers? If so, then yes, let’s learn vectors and containers!
ОтветитьSince you mentioned older C standards didn't allow it, is there any overhead (apart from fetching from memory) associated with dynamically allocating an array with the value stored in an integer variable?
Ответитьplease make a video on vectors
ОтветитьJust found your videos, and OMG thank you so much I have learned so much, your videos are so informative and the knowledge is great.
ОтветитьThank you for this!
ОтветитьHi dear professor, do you have any C++ 20 tutorials????? Can make C++ tutorials PlesssssssssssssssssssZZZZZZZZZZ!!!!
Ответитьhey:
to get the sizeof array: do
```{c}
int length=sizeof(array)/sizeof(array[0]);
```
We want more c++ videos ❤️
Ответитьso a variable length array is a dynamic array under the hood?
ОтветитьHi Jacob, are you planning to do some C++ tutorials?
ОтветитьI really like your videos. It helped me a lot. Please can u make tutorial videos for nasm?. Just for beginner!
I have tried to see it but i didn't understand anything
I've recently revisited C/C++ having not really done much with it in about 15 years. Your videos have really helped strengthen my fundamentals and brush off a lot of the cobwebs. Thanks for that!
If you decide to cover some C++ topics, I'd love to see some stuff on the nitty gritty of streams. I can implement something using them but always felt that I've got a bit of a blind spot with what's going on under the hood.
Can U ref to or create a video on handling charsets like utf8 utf16 in C
ОтветитьHi! Jacob🙂. I learned a lot from your channel. I was having trouble about learning and using variable argument list when implementing printf for school project. After watched your video(the video is just about 4~5 minutes long, simple and straight to the point), Things came clear to me. I realized It is actually not that complicated.
Thanks for the helpful content!
I think It would be really helpful also if you can make a video about writing unit test, what general, edge case we should be careful for, (this may sound broad), and tool we can use, etc...
Wouldn't myarray[5] in the function parameter be cast to just be a pointer to an int?
ОтветитьI would love to see a video on smart pointers in C++. Specifically how they work under the hood and what are some good use cases for when we should be using smart pointers and when not to use smart pointers. Also if possible, can you do a video on memory checking tools like valgrind? Great videos by the way!
Ответить