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
It's 10:30 PM
Europe detected
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
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;
Anonymous
What is DLL hell problem..??
S.
What is DLL hell problem..??
http://lmgtfy.com/?q=dll+hell
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.
😛
Talula
i solved my problem :p
And what was your problem?
Victor
error: main must return int
S.
error: main must return int
Is that forced by standard?
S.
oh really ... let me have a check
Victor
oh really ... let me have a check
C++98 or C++11, section 3.6.1
S.
C++98 or C++11, section 3.6.1
Oh I'm reading 17
S.
I have doubt because it's not for C
S.
C++98 or C++11, section 3.6.1
Hmm seems it allows implementation-defined return type? This sentence is obscure
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!
Victor
For C, it's
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
"void main()" compiles on gcc (only a warning), but reports an error on g++
Yeah, thats normal, I think its the same on clang and clang++
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++
Talula
int main()
Talula
You can't return if you have void main()
Anonymous
This understanding complies with the standard.
Yee, it's always funny when people think C is a subset of C++. It isn't
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).
Anonymous
Though almost true
Yeah, but almost it not completly
S.
OK can I write auto main()?
Victor
😂
Victor
gcc, clang and msvc actually support: int main(int argc, char **argv, char **envp)
Anonymous
OK can I write auto main()?
Hmm, you can use auto main() -> int xD
S.
😆
Victor
on macOS, clang supports: int main(int argc, char **argv, char **envp, char **apple)
S.
( not really useful i think
Anonymous
Hmm, you can use auto main() -> int xD
or even auto main() -> decltype(0) should also work
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