Stanislav
constexpr std::string & std::vector
Stanislav
operator <=>
Stanislav
and finally math constants is in standard
joel
you're not stating differences you're just being random
Stanislav
https://en.wikipedia.org/wiki/C%2B%2B20
Stanislav
Anonymous
Can anyone plz tell me which is the best ide for c programming??
Osa
How you learn c language
Mat
How you learn c language
Learning it... Studying the theory, practicing and doing some little projects
Osa
Can you teach me c lenguage please
Dima
What the hell
Mat
Can you teach me c lenguage please
Gosh, are you willing to pay?
Osa
Yaaa
Anonymous
Thanks.
Mat
Yaaa
There are a lot of books and courses on the net. Use them :) usually the prices are kinda low for what they teach, and sometimes they're free, too.
Osa
Can you send that links
Francisco
Can you send that links
Can't you use Google like anyone else?
Osa
Ok
Osa
But how can i learn c language
Osa
If u dont mine can u teach
Dima
Nobody will
jack
How to make this pattern in c?? Plz hlp.. tell me only logic 1 23 456 78910 11 12 13 14 15
for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { printf("x++"); } printf(" "); }
joel
If u dont mine can u teach
learn it yourself you have a brain
jack
no
ok
jack
👍
joel
there is something you gotta do within the inner loop
joel
declare a temp var outside the two loops
joel
and assign 0 to it
jack
i just told the logic
joel
no it's wrong
Francisco
i just told the logic
You gave a completely wrong code snippet
jack
forgot to use \n at where i gave space for outer loop
jack
for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { printf("x++"); } printf("\n"); }
Anonymous
#include<iostream> using namespace std; int* fun() { int arr[2]={1,2}; return arr; } int main() { int *arr; arr=fun(); cout<<arr[0]<<" "<<arr[1]; }
Anonymous
why this is working??
Anonymous
how local variable address can be returned
Anonymous
i think it get's destroyed after the call.
Anonymous
if the arr is getting destroyed
Mat
arr inside fun is destroyed, but the value is copied into the arr inside main before that
Anonymous
then how it can return it
Mat
bro i used pointer to return a address
So what? An address is a value
Anonymous
but it the arr space i created if it is getting destroyed how it can display
Anonymous
if address is copied in main arr
Anonymous
if the values on that array gets destroyed
Anonymous
how can we get the value
Mat
The variable named arr inside fun is destroyed, but the array is still there. Before that, fun's arr is copied inside main's arr. Now main's arr holds the address of that array
Mat
array will not gets destroyed??
It's not like someone will go and wipe all that memory.
Anonymous
https://www.youtube.com/watch?v=RWNM7CzDNyY watch this video in this the same code gives array.
Anonymous
sry gives * error.
Mat
sry gives * error.
Which minute?
Anonymous
Ariana
It should be easier to think of it this way Functions return one number, it could represent a integer, float, character, pointer etc. Any local variables can effectively be considered gone after returning So since functions can’t return like multiple numbers, you’ll got to return a pointer
Mat
0:53
I see a warning, not an error. They're different.
Anonymous
Anonymous
after function call.
Anonymous
the memory space created will not get wiped out??
Ariana
Local variables can be considered gone after returning Local variables are 'pushed' onto the program stacked and 'popped' once you return
Mat
the program stopped after that
Fact is you should hope the right address is passed to main's arr, as that address (the one inside fun's arr) has only fun's scope. Usually you create the pointer in your calling function (main in this case) and you pass it to your called function (fun in this case)
Anonymous
so why the elements are still present in same array
Ariana
So basically how local variables work is that it gets pushed to a stack, then it gets popped So what it means to get popped is that the area can be overwritten, so the pointer may still be valid, but if you say call another function you’ll have almost no clue what is the pointer doing