Anonymous
Anonymous
Mihail
but std::cout is line-buffered, so it does that with '\n'
Dima
Azrul
What is (- >) that means??
Anonymous
Liam
What is (- >) that means??
member operator. It has two operands. The left operand is a pointer, who points to a struct or class object. The right operand is the name of a member of that object. The result of the operator is the reference of the member of the object pointed by the pointer.
Liam
Azrul
New =(data*) malloc(sizeof(data));
Azrul
Vikas
There is nothing like this in cpp.
Either you should allocate memory using new operator or malloc
Using new operator:
<struct_type> data = new <struct_type>();
Using malloc :
<struct_type> data = NULL;
data = (data*) malloc(sizeof(data));
Farhan
Morgan
Morgan
Liam
New =(data*) malloc(sizeof(data));
malloc sizeof(data) bytes of memory, and returns the pointer to the memory snippet, if success. Then, convert the type of the pointer from void* to`data*, and store it in `New.
Anonymous
Hello everyone
Raju
🙂
P k
P k
Can anyone say hw we got output
Anonymous
Sure.
P k
S.
Then i guess you just need to trace it step by step using a pencil and paper
P k
S.
Like … fun(4, 5), x>1, fun(2, 7), x>1, fun(0, 9), now x is not >1, print y, the first output 9; look back to the upper level, in fun(2,7), now if block is finished, print y, the second output 7 …
Kaku
Sir i want to run graphics program in codeblocks
Kaku
Then how can i do ?
S.
Anonymous
Morning every body am a beginer in programming and i need help to write a program
P k
Like … fun(4, 5), x>1, fun(2, 7), x>1, fun(0, 9), now x is not >1, print y, the first output 9; look back to the upper level, in fun(2,7), now if block is finished, print y, the second output 7 …
Ha sry typo mistake second round x bcming 0 but answer is not matching
S.
Frederick
/cbook
Frederick
/cbook
S.
Dima
ayy lol
Kaku
Meenal
🙏🙏
Dima
Dotevo
Hello :-) I'm looking for a nice solution for static vector of vectors added in constructor.
constructor(int X) {
STATIC_VECTOR[X].push_back(this);
}
but
Dotevo
vector < vector<Objs*> > STATIC_VECTOR;
Dotevo
vector containsts const elements. Should I change it into vector < vector <Obj*> * > ?
Francisco
Dotevo
I do not want to make it const but vector contains only const values.
Dotevo
and i cannot call push_back() there
S.
You mean Objs* is const?
Dotevo
1. vector < vector<Objs*> > STATIC_VECTOR;
2. vector<Objs*> n = STATIC_VECTOR[i];
3. n.push_back(this);
NUmber 2 will not compile because there is a casting from const.
Dotevo
It is possible to avoid it with:
1. vector < vector<Objs*> *> STATIC_VECTOR;
2. vector<Objs*> *n = STATIC_VECTOR[i];
3. n->push_back(this);
Dotevo
but maybe there is a nicer solution then use pointers.
Anonymous
Koi big c program send karo
Anonymous
Any corner case code chef and beautiful digit
Anonymous
?
Silvestr
sorry foe dumb question, but how delete shared pointer?
Silvestr
I mean I passed it to function and want clean it inside function
Ariana
shared pointer?
Silvestr
shared pointer?
Yeah, I have two threads that access to some resource(no data races), but problem is in next -> when one thread use resource I want delete this resource and in second thread just check if it is not a nullptr
S
student(int r):roll(r) {}
S
what does it mean?
Silvestr
What is best practice for doing such things?
Silvestr
Silvestr
you call costructor of roll object
S
Anonymous
Welcome ajat
Anonymous
Thankyou c
klimi
welcome
Anonymous
Dima
./ban communist propaganda
Dima
Anonymous
Lol
Thespartann
Roxifλsz 🇱🇹
>"book to mastery"
>a book about something that didn't work in real life
Roxifλsz 🇱🇹
S.
Living in a communist country but never read it ... will definitely have a read, thx for the recommendation 🌝
BinaryByter
real communist countries don't exist
Thespartann
S.
Only with the name left
BinaryByter
communism has never existed as proposed by marx
Thespartann