I'm really curious as to why when you assign the size of your array to 'x' that it doesn't throw you an error about the array needing to be a constant value.
5:04 that's a bad practice and not "completely valid". In the compilation phase, while allocating memory for variables X does not have an assigned value, so you cannot create an undefined sized array. This will lead to crashes when you are using older/low level C/C++ compilers (lets say you are working on 8086 systems). Do not use this. Defining your array size as MACRO is the way to go. However if you are using never versions of C++ compiler, this will be handled automatically, but will lead to performance loss.
Thanks a lot! I encountered the issue you mentioned. I was trying to figure out why, but didn't find any helpful info until now. I am not sure what you mean by defining array size as macro? Could you explain more to me? Thanks!
Bro couldn't even teach std::array, C-like array decaying to pointers when passed as a function argument, or that you can't return a C-like array from a function, just update yourself before teaching stuff to beginners
Nice video Tim. Small tip - you can execute the c++ code inside the sublime text by creating a build system for it. Which will automatically compile and run the code.
@@alexander_0749 Yeah the build code is system.run(visual studio.exe). Lmao joking. I know ur comment is 3 years old, but thought I'd have some fun. No need to compile these days, eh?
I always thought that C++ is hard! But with your tutorials and prior C and Python experience it's not that hard as I thought! Thanks for making these tutorials!
Why doens't the size it takes in byte it gives from sizeof() change between a string that's only 2 characters and a string that's 10 million characters that makes the entire file more than 16 megabytes in size???
No it's random, because when you don't initialise the values of any array of any variable, c++ gives it a random value and then stores it in the RAM because you can't store anything empty inside the RAM
I think the word that you are looking for is implicate, or Implicitly define the size. Although, I guess you could say that "we can defer the size of the array to the complier" or something like that, which would mean the same thing technically. Sorry, haha!
You cannot use a variable as the length of an array, that is a GNU extension. The length of an array must be a constant expression. You can get the length with .size if you use std::array.
interesting. But I can't wait until you do something with "while statements" and "for loops". that is if you do. I mean those are pretty important aren't they? I hope you do.
that's pretty sad, you're presenting the C syntax and not the C++ syntax which requires the header , not showing how to program in modern C++ in 2021 isn't that good unfortunately. :/
Make a long one for pointers and references please
Dude you are the only person that I don't skip the adds so that I support you.
Your content is really good for beginners who want to learn C++. I know C++ but could not teach it as well as you do
OMG FIRST HI TIM I LOVE YOUR CONTENT
I feel the need to say it each video, but I do appreciate these videos. You are a good man
I'm really curious as to why when you assign the size of your array to 'x' that it doesn't throw you an error about the array needing to be a constant value.
Same
I was waiting for the compiler to throw an error but it didn't
5:04 that's a bad practice and not "completely valid". In the compilation phase, while allocating memory for variables X does not have an assigned value, so you cannot create an undefined sized array. This will lead to crashes when you are using older/low level C/C++ compilers (lets say you are working on 8086 systems). Do not use this. Defining your array size as MACRO is the way to go. However if you are using never versions of C++ compiler, this will be handled automatically, but will lead to performance loss.
Thanks a lot! I encountered the issue you mentioned. I was trying to figure out why, but didn't find any helpful info until now. I am not sure what you mean by defining array size as macro? Could you explain more to me? Thanks!
Second view
You have no idea how much i needed this thank you so much
Bro couldn't even teach std::array, C-like array decaying to pointers when passed as a function argument, or that you can't return a C-like array from a function, just update yourself before teaching stuff to beginners
Nice video Tim. Small tip - you can execute the c++ code inside the sublime text by creating a build system for it. Which will automatically compile and run the code.
hey can u plz tell me the build code? mine's not accepting any input
@@alexander_0749 Yeah the build code is system.run(visual studio.exe). Lmao joking. I know ur comment is 3 years old, but thought I'd have some fun. No need to compile these days, eh?
How do you edit your thumbnails??
using his computer, his hands eyes and brain
I meant to ask about the software he uses..
I always thought that C++ is hard! But with your tutorials and prior C and Python experience it's not that hard as I thought! Thanks for making these tutorials!
chillin
Why doens't the size it takes in byte it gives from sizeof() change between a string that's only 2 characters and a string that's 10 million characters that makes the entire file more than 16 megabytes in size???
String is stored in memory aka RAM not in the actual file LOL
@Peterolen Thanks, that makes sense
13:07 are this numbers always the same?
No it's random, because when you don't initialise the values of any array of any variable, c++ gives it a random value and then stores it in the RAM because you can't store anything empty inside the RAM
@@segsfault thanks for answering my question
I think the word that you are looking for is implicate, or Implicitly define the size. Although, I guess you could say that "we can defer the size of the array to the complier" or something like that, which would mean the same thing technically. Sorry, haha!
Your vids are amazing
this channel is so underrated
Hey Tim can u pls make a video on socket in detail i have seen ur video on socket they are not clear. can u pls make anothet
You cannot use a variable as the length of an array, that is a GNU extension. The length of an array must be a constant expression.
You can get the length with .size if you use std::array.
yuh that was a bad move
Heyy. Can you please make a video about json reading and writing & parsing tutorial.
Hi tim is just idea but can you do a intermediate tutorials of Javascript maybe? its just idea
Can you create a video recorder in python but from scratch without module
Hey Tim,
Pls make a video on Mastering Java Everything You need to know
Your the best!!!
are you going to cover vectors and stl?
patience young one
interesting. But I can't wait until you do something with "while statements" and "for loops". that is if you do. I mean those are pretty important aren't they? I hope you do.
that's pretty sad, you're presenting the C syntax and not the C++ syntax which requires the header , not showing how to program in modern C++ in 2021 isn't that good unfortunately. :/
@Peterolen what do you mean by regular exactly?
do you wear pink thigh high socks and cat ears in your spare time?
Thank you very for your lesson🫶🏻
I will follow your series till pointer part :V
plz make a video on Vim and it' s plugins
int x = 5;
int arr[x]; is incorrect isn't it.
Yeah, I think we need to make the size constant.
const int x = 5;
int arr[x] = {2, 3, 4, 5, 6};
You have to break up your words
I was olmost frist
put it on ur cv
@@2mftoomanyflowz953 cv?
@@DextenXD basically a resumé
Hey Sir, can you create a tutorial on PyCairo
Is this text editor sublimeText
I have a question
What if I want to create an array of 1 - 200 but dont want to manually type the number?
You could use loops to append to the array.
lol I already figured it out
list[200];
for ( i = 1; i
Thank you...
these videos are really helpful !!
great video as always, but what if want to do an array of arrays to define a matrix or so??
you looking good on subs brother
This was really an awesome and detailed lecture 🙌
Hi, is it possible to assign an integer value, greater than 2^32-1, as element of an array of integer type?
Use longs or long longs.
Thank u Tim
Amazing video.
19:38 wait a minute you dont entered return 0; how it is compiled
@Peterolen oh thank you. learned a lot from you
g++ -Wall -o executable.exe code.cpp
This would give you a warning about not returning from main (I guess)
Thanks
hello
thanks tim
why dont you use visual studio?
@Madhavaraj s oh ok tnx
tim is the GOAT
I love your videos!
Thanks!
Hey tech with Tim! I love your videos
Who's tech with Tom?
Are you going to do a serie for developing backend with c++ ?
Hey tim. Please make a series on python algorithms
21 minute long video and total waste content. Just talking about errors. Instead you should have talked about methods and function of array
Hello Tim thanks for this series. Can you do a video on the iomanip class. That would be really helpful
@Peterolen that's what I meant. Been studying classes so I have them in my head. Thanks for the clarification