András
Gcc compiler will compile that
Ilya
András
But it's compiler feature
András
Ilya
Ilya
Stanislav
Stanislav
warning: variable length arrays are a C99 feature [-Wvla-extension]
András
Ilya
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?
Anonymous
Dede
András
kappa
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
Ilya
Bojan_Krdemn
will the algorithm throw an error
Bojan_Krdemn
or it will rewrite the key
Anonymous
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
Bojan_Krdemn
yeah, i can experiment with ide, but may be you guys can tell from head.
Anonymous
Anonymous
What hard in reading docs?
Anonymous
Wat
Bojan_Krdemn
ok, found something https://en.cppreference.com/w/cpp/container/map {insert or assign}
Artöm
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?
Ilya
Bojan_Krdemn
it performs the same functions, doesn't it?
Ilya
Bojan_Krdemn
what prevents me from abandoning that crutch
Ilya
Tomas
Is there a way to know if popen output is from stderr or from stdout?
Ilya
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
Ilya
AMIT
C tutorial please
AMIT
With e books
holo
nut shell
AMIT
I_Interface
AMIT
Thanks
Khan
what is the fuction of fflush(stdin) ?
Anonymous
I_Interface
Khan
Dima
someone ban this one
Dima
I forgot how to get its id
Zarret
Anonymous
olli
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
SjD
thanx helped a lot
András
#cbook
I think #cppbookguide will better in this case