András
Gcc compiler will compile that
András
But it's compiler feature
Ilya
Well yes, but actually no
Actually no, this is not valid code.
Ilya
Gcc compiler will compile that
Because this is GCC extension, unsupported by other compilers.
András
András
Because this is GCC extension, unsupported by other compilers.
Becouse there is no such array definition in standard, and only gcc have made it
Ilya
Becouse there is no such array definition in standard, and only gcc have made it
I Am trying to say same thing, this is not valid C++ code
Stanislav
Stanislav
warning: variable length arrays are a C99 feature [-Wvla-extension]
Loki
Hello guys, any vim user here? I created a shortcut mapping to compile and run my c++ code on neovim. But seems, this shortcut is not working when I open a new buffer. Any idea?
Loki
Use normal IDE, not this And VIM is offtopic here
oh sorry, I didn't know vim is offtopic here. I just love writing on vim. Anyway, thanks.
András
Use normal IDE, not this And VIM is offtopic here
Why you hate vim? If u want so, you can describe in OT or private
kappa
Please help me 🤚 Reverse digit of a number using a recursive function..
Take out no of digits and make an araay and in recursion while(n!=0)
Anonymous
#include <iostream> #include <cstdio> using namespace std; int main() { int n1,n2; string a[9]{"one","two","three","four","five","six","seven","eight","nine"}; cin>>n1 >>n2; if (n1%2==0) cout<<"even"<<endl; else cout<<"odd"<<endl; if (n2%2==0) cout<<"even"<<endl; else cout<<"odd"<<endl; for(int i=n1;i<=n2;i++) cout<<a[i-1]<<endl; return 0; }
Anonymous
please help
Anonymous
this code print even and odd for n1 and n2
Anonymous
#include <iostream> #include <cstdio> using namespace std; int main() { int n1,n2; string a[9]{"one","two","three","four","five","six","seven","eight","nine"}; cin>>n1 >>n2; for(int i=n1;i<=n2;i++) cout<<a[i-1]<<endl; if (n1%2==0) cout<<"even"<<endl; else cout<<"odd"<<endl; if (n2%2==0) cout<<"even"<<endl; else cout<<"odd"<<endl; return 0; }
Anonymous
this dont
Anonymous
can tell why
Bojan_Krdemn
Hey! What is happening inside a map when algorithm insert a dublicate key there?
Bojan_Krdemn
consider a map Dan - 1954 Pete 1945 Joe - 1987 then i insert Dan 1946
Bojan_Krdemn
will the algorithm throw an error
Bojan_Krdemn
or it will rewrite the key
Bojan_Krdemn
readed, no clarity. unique keys, ok. and if i have a map kinda of <Name, vector> and when i add Dan 1946 i want the vector to hold two values, namely {1954, 1946}
Anonymous
Read the docs
please mine issue too
Bojan_Krdemn
yeah, i can experiment with ide, but may be you guys can tell from head.
Anonymous
yeah, i can experiment with ide, but may be you guys can tell from head.
Read the documentation already or you'll get the warn
Anonymous
What hard in reading docs?
Anonymous
Wat
Bojan_Krdemn
ok, found something https://en.cppreference.com/w/cpp/container/map {insert or assign}
Bojan_Krdemn
Hasn't that realisation of map https://web.stanford.edu/class/archive/cs/cs106b/cs106b.1126/materials/cppdoc/Map-class.html#Method:containsKey become obsolette with 17th version of C++? What do you think guys?
Bojan_Krdemn
it performs the same functions, doesn't it?
Bojan_Krdemn
what prevents me from abandoning that crutch
Tomas
Is there a way to know if popen output is from stderr or from stdout?
Tomas
this should not make any difference for you
I have a lot of popen calls with different commands. How else would i know if command succeeded or not, and id if it didn't what went wrong?
uniq
How can i check is exist process without folder /proc in Linux? I tried making kill(pid,0), but this instruction making process and giving pid of myself
AMIT
C tutorial please
AMIT
With e books
Ilya
C tutorial please
No tutotials, read books
holo
nut shell
AMIT
No tutotials, read books
Can you suggest some?
I_Interface
AMIT
Thanks
Khan
what is the fuction of fflush(stdin) ?
Anonymous
what is the fuction of fflush(stdin) ?
/report Doesn't google
I_Interface
what is the fuction of fflush(stdin) ?
Try to google it, don't be so shy.
Dima
someone ban this one
Dima
I forgot how to get its id
Zarret
Anonymous
olli
what is the fuction of fflush(stdin) ?
Undefined behavior, don't do it
SjD
/cppbook
SjD
/saved
SjD
cppbook
SjD
#cppbook
SjD
/get cppbook
MilkBeforeCereal
that's not a note name...
MilkBeforeCereal
you have to pick one from the list
SjD
ok thanx
I_Interface
cppbook
#cbook
SjD
thanx helped a lot
András
#cbook
I think #cppbookguide will better in this case