Ashish Bhushan
I mean why everyone ask that i want to learn c or c++ ....only way to learn is to start by yourself
Ashish Bhushan
Internet has everything you need
Ashish Bhushan
Everything you can find on the web....from books to videos
Anonymous
ohhkayyy. . .
let me write because i understand that way,
so my 0 100 0000 has become
1 000 0000. . .
1s compliment: 111 1111,
adding one,
000 0000!!
1 000 0000!!!!
it is indeed -128!!
woww its simple, thanksssss !!
MᏫᎻᎯᎷᎷᎬᎠ
How similar is Cpp to JavaScript and Php?
I am a beginner, I have learned web development, I wanna learn programming languages like Cpp and Java, will my prior knowledge on JavaScript and Php help me to learn it? How similar are they?
https://redd.it/g5h33p
@r_cpp
MᏫᎻᎯᎷᎷᎬᎠ
Just a little bit or Maybe NO
MᏫᎻᎯᎷᎷᎬᎠ
Most likely they will fall into the same trap when C dev migrate to C++
MᏫᎻᎯᎷᎷᎬᎠ
At least C has a bit of type safety
Dima
lol
MᏫᎻᎯᎷᎷᎬᎠ
Well
Both of us can't judge whether it's easy to begin with 0 knowledge or a web background
MᏫᎻᎯᎷᎷᎬᎠ
I myself started C++ at first at the time I didn't know what IDE is
I did write on papers tho XD
Hermann
Just another update right?
MᏫᎻᎯᎷᎷᎬᎠ
Got nothing to say then :)
Anonymous
hello, please, can someone can explain the difference between for(auto&& stuff : stuff_container) and for(auto& stuff : stuff_container)?
Sasuke
This code works
#include<iostream>
using namespace std;
int f1(){
int m = 0;
return m;
}
int main(){
int x = f1();
return 0;
}
But this isn't why?
#include<iostream>
using namespace std;
int *f1(){
int m = 0;
return &m;
}
int main(){
int * x = f1();
return 0;
}
Anonymous
Sasuke
Sasuke
And asking why one snippet works and other isn't
Anonymous
Anonymous
yep, but what could be better use in a general case like that?
Sasuke
Ah I see
Sasuke
Thanks both of u
Anonymous
yes, but I'm thinking about only similar for loop on containers, what could be better use?
Anonymous
👍, many thanks
Sampurna
Can someone solve this please
Dima
I_Interface
Anonymous
Hello everyone
zelika
hi
Sasuke
Anonymous
no no no not at all.
unless there are some mistakes in my code then u can point out, like maybe a bad practice... would appreciate that
Anonymous
Hey Guyzzzzz I am the bigenginer in C plz suggest me that this channel is good
Anonymous
For me
Sasuke
Anonymous
Sasuke
Sasuke
Int *m = (int *) malloc(sizeof(int));
Anonymous
Sasuke
Coz "static" variables have file scope it is more error prone it has higher chances of getting changed elsewhere in the program unintentionally.
Sasuke
It is considered bad practice to use global variables unless to much necessity
Sasuke
Anonymous
Sasuke
Sasuke
Why that static variables isn't file scope? Static variables are supposed to be file scope?
Sasuke
What new meaning?
Sasuke
Oh then whats the scope of a static variable in a function or a block?
Sasuke
Type deductions in c++03 not C all standard and the code guy wrote is in C coz of stdio.h file and that's what I told it has auto scope which is block scope u ar saying. And why the behaviour is undefined? auto int m = 0; has a defined behaviour we just defined it as 0
Artöm
Sasuke
If lifetime is of the program then we can return the address of that variable right?
Artöm
Sasuke
Yes I understand auto int m; and int m; are same thing
Anonymous
Sasuke
I think You are confused
Anonymous
Sasuke
Yes in this sense you are right
Anonymous
he said mutalib had stdio.h which meant C. i don't think there is a confusion
Sasuke
Sasuke
Yes coz I misunderstood in what sense he is saying it undefined my bad
Sasuke
😂😂😂
Sasuke
Chill
Anonymous
ye so the argument became
"auto n = 5; when compiler doesn't support type deductions is undefined" which is true. but the other side was still talking about auto int n = 5;
Sasuke
Artöm
Sasuke
Not again 😂😂
Sasuke
+1
Anonymous
Anonymous
omg what has happened
Anonymous
lul
Anonymous
can i do sticker spam before purge?
Sasuke
Anonymous