klimi
Yes
klimi
It's Sameer heereee
klimi
Fuuuuck I m fucked up
klimi
Why I'm so greedy why I don't have self-control
klimi
Why do I now pity myself
klimi
T.T
MᏫᎻᎯᎷᎷᎬᎠ
Dafaq!
Dima
MᏫᎻᎯᎷᎷᎬᎠ
Dima
Toto - Africa
Dima
oh yeah
Dima
yes, but reserve first!
MᏫᎻᎯᎷᎷᎬᎠ
Noo
Dima
use std::
Dima
don’t use using namespace std;
klimi
klimi
Check pm
Anonymous
Sure, it'll compile (after you use std::, include the headers etc etc), but your code is unsafe and overflow the vector bounds. Don't use a vector that way.
klimi
Because when you want to put data into [0] it doesn't exist
swarnim
Better do it,
for (auto i : vecto) {
cin >> i;
}
klimi
If you push it back once then the [0] is created and you can save into it
klimi
No
klimi
How many "nodes" you create... That many you can save
klimi
I thought it won't work
Dima
Do you even read?
Dima
I told you to reserve first
Dima
and never use using namespace std;
BinaryByter
Anonymous
What is DLL hell problem..??
Anonymous
damn
S.
What've you posted ...?
Anonymous
code snipped
S.
oh you can post it again now i guess
Anonymous
i solved my problem :p
S.
😛
Victor
error: main must return int
Victor
S.
oh really ... let me have a check
Victor
S.
S.
I have doubt because it's not for C
Victor
It shall have a return type of type int, but otherwise its type is implementation-defined.
S.
😂 what does it mean actually
Victor
main shall return int, but main's type (not main's return type) is implementation defined
Victor
for example, main's type can be
int ()
or
int (int, char **)
etc
S.
Oh I see, thx!
S.
Victor
yes. Actually, "void main()" compiles on gcc, but reports an error on g++
S.
S.
So pedantic, such questions
Victor
"void main()" compiles on gcc (only a warning), but reports an error on g++
Anonymous
S.
S.
Oh i see, two warnings
Anonymous
I always thought void main() is allowed in the C standard but not in C++ standard. Does it depends on your implementation?
Anonymous
Always thought that would be one of the rare things which makes C sometimes incompatible to C++
S.
Victor
Talula
Talula
You can't return if you have void main()
S.
Though almost true
Victor
C standard says compilers must support int main(void) and int main(int argc, char **argv), but can also be implementation-defined.
C++ standard says main must return int, and others are implementation-defined, but compilers must support int main() and int main(int argc, char **argv).
S.
S.
OK can I write auto main()?
Victor
😂
Victor
gcc, clang and msvc actually support:
int main(int argc, char **argv, char **envp)
S.
😆
Victor
on macOS, clang supports:
int main(int argc, char **argv, char **envp, char **apple)
S.
S.
( not really useful i think
Anonymous
Cause int main() is too boring
Victor
Language:
clangplusplus
Source:
#include <iostream>
auto main() -> int
{
std::cout << "Hello World" << std::endl;
return 0;
}
Result:
Hello World