Jussi
Go program some JavaScript
Lionel
Will there be a run time decision as to where the register variables will be stored if the cpu registers are full?
Jussi
how the hell could the processor do such checks?
Anonymous
Lionel
Ilya
What if the cpu registers are fully occupied, does the remaining register variables will be pushed onto the stack?
BTW on the one most popular of hardware platforms now, Intel, number of general purpose registers is very limited, namely, 1. Or close to it
Lionel
how the hell could the processor do such checks?
Just asking. I'm a tyro at this
Ilya
And if you are so interested in this topic, you must know that every variable (lvalue) has an address which can be used in the program. Register variables in general cannot have an address. So if the address of a variable is really used in the program, it cannot be located in registers.
Lionel
Any books for conceptual understanding of c/c++? Recommendations!
Anonymous
Any books for conceptual understanding of c/c++? Recommendations!
C++ and C are different languages with different idioms
Lionel
Okay suggestions for books on C and c++?
Anonymous
Okay suggestions for books on C and c++?
I'd recommend to learn c++ first
Anonymous
https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
Jussi
I'd recommend to learn c++ first
I'd recommend learning C first, it is much easier
Jussi
learning C takes something between a couple of months to a year
Jussi
C++ I'm still learning after 4 years
Jussi
It's easier but unsafer
Dunno, I've had way more segfaults with asynchronous C++ shit than with raw pointers in C
Jussi
https://youtu.be/YnWhqhNdYyk
This is just why you should not learn C++ through C
Anonymous
RAII, templates and other make C++ is more type safe language
Jussi
yes
Lionel
If a pointer is not dereferenced properly, it results in segmentation fault or compile time error?
Lionel
RAII, templates and other make C++ is more type safe language
I've been learning c++, but still haven't learnt that much about templates yet
Anonymous
This is just why you should not learn C++ through C
Well, you got my point It's a controversial topic
Anonymous
Compiler can't guess that a pointer is invalid
Lionel
For eg. Let's say a is a 3D array of characters and I dereference it, what's the result.
Jussi
2D array
Jussi
most likely
Lionel
Okay. I'll look into it👍
Anonymous
Or std::array
Pro
This is just why you should not learn C++ through C
actually personally i had no problem learning c++ after c c++ was quite easy to learn for me though
Pro
i dont think it is worrysome thing
Jussi
the point of the video is that you should not write C++ like you wrote C
Pro
yeah that i agree
Jussi
yeah
Jussi
otherwise you should downgrade your compiler to to C++98
Anonymous
Guys, how can I get first two numbers from argument in C like this: ./crack 51v3nsnsjshrvej I need variable, which should take 51.
Jussi
I guess you can use sscanf
Pro
C and C++ have their own set of potential and have their own ways of execution.
Pro
can u explain it please?
Lionel
Not sure about c, but c++ would thrive atleast for another 10 yrs in the market
Lionel
What's the logic behind int arr[3] ={1,2,3}; If arr[3] is printed, it gives 0. And arr[4] gives a garbage value
Lionel
What's the logic behind int arr[3] ={1,2,3}; If arr[3] is printed, it gives 0. And arr[4] gives a garbage value
Why is that the next element after the max size gives zero. In this case, it is arr[3] !?
Liam
What's the logic behind int arr[3] ={1,2,3}; If arr[3] is printed, it gives 0. And arr[4] gives a garbage value
Valid range of index is [0, 2]. For 3 and 4, both of them are invalid index. Dereferencing them causes undefined behaviour.
Anonymous
You accessed element out of range of the array
Lionel
So it depends on the compiler?
Liam
Liam
And it also depends on run time memory allocation.
Anonymous
So it depends on the compiler?
This code can format your hard drive, for example
Anonymous
Because it's UB
Liam
lol
Anonymous
It won't happen of course, but it'd be a valid behavior of the program
Lionel
What's the logic behind int arr[3] ={1,2,3}; If arr[3] is printed, it gives 0. And arr[4] gives a garbage value
If I try it with 10 elements (arr[10] ) , and if I try to access arr[11] ,it gives 0. So it seems like an undefined behaviour
Lionel
👍
Anonymous
https://www.youtube.com/watch?v=u_ij0YNkFUs
Anonymous
A review of Modern C++ by the C++ creator
Anonymous
C++ becomes more and more powerful and modern language every 3 years
Anonymous
/save stop-teaching-c https://www.youtube.com/watch?v=YnWhqhNdYyk
Anonymous
/save cppbookguide https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
Anonymous
https://github.com/microsoft/STL/ Microsoft has open-sourced its STL implementation!
Lionel
Regarding the rule for implicit conversion in c, the operand with lower data type is converted to higher datatype? So int < unsigned int < float < double would be crt?