a
a
Francisco
What is the use of this pointer
The "this" pointer points to the actual instance. I usually use it in methods that update the instance, but need a function that returns a new instance. For example:
class Test{
Test next() const{
Test ret{*this}; // This is a copy of the original
// Do some work...
return ret;
}
Test& update(){
*this = this->next(); // Here we update the original using a new instance
return *this;
}
};
Aisyah
How can i declared the prime number using c++
Aisyah
Using function
Francisco
Ignoring your English quite sucks, what have you tried so far?
Walter
What is terminated and non terminated decimals??
Anonymous
Anonymous
This seems like a pretty simple question to google.
Walter
Anonymous
Then why didn't you ask that question?
Anonymous
Eh, whatever.
Walter
Anonymous
Video from okenyikevin9
Dima
Bruh
Giovanni
i have a question on openMP and pipelines
András
Giovanni
suppose i have 4 cores and i need to execute a pipeline of 2 stages..so i give 1 thread to each stage..then how can i use the 2 more threads free to improve the efficiency?
Giovanni
and suppose that the 2 stages are basic..so they cannot be splitted more
András
I think yes
Giovanni
i'd like to know how
Anonymous
Wanted criminal
Wisenky
Guys someone would tell me why I take this error ?
Wisenky
Wisenky
Wisenky
Dima
Dima
take address
Wisenky
Wisenky
Anonymous
hi guys
Wisenky
take address
also am I on the wrong way to getting values to put them in struct
Hubert
second : block1, block2, block3 is pointer, you should use -> instead of .
Wisenky
I come over this error but why the 94th code line doesnt work and returns with 96 ?
Wisenky
Wisenky
how can I get 11th line's values or something else ? Anyone would tell me ?
Johnz
How on Earth can I get current date and time as string?
Johnz
With what? Chrono or ctime?
MᏫᎻᎯᎷᎷᎬᎠ
I there are static methods in std::string class iirc
Johnz
Or boos is better idea?
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
You don't have to overkill it
MᏫᎻᎯᎷᎷᎬᎠ
What library do you use to get those dates and time
Johnz
Tried all of them.
Johnz
simple task became too complicated
Johnz
for small program)
Johnz
i dont need complete solution... just point to right direction
MᏫᎻᎯᎷᎷᎬᎠ
Do you know how to get time and date from whatever it's in an integer representation?
Dima
Lol
Johnz
i have time_t obj. And my main idea is to append current date and time to file name. to do that i need time in string format
MᏫᎻᎯᎷᎷᎬᎠ
klimi
Anonymous
Johnz
Thank you all.
Johnz
Its Alive!!!111
Johnz
)
MᏫᎻᎯᎷᎷᎬᎠ
You're welcome
Johnz
But what to do with error C4996: 'localtime': This function or variable may be unsafe. I know that i can use pragma to disable this.... but..
Anonymous
it is recommended to use %hd; however according to default argument promotion when using a function with variable length arguments like printf, it is safe to use %d
Anonymous
sometime you might use same format string in printf and scanf
Mar!o
professor
I Have a question
what does mean inline asm here
void help() {
asm("jmp rsp");
}
int main(int argc, char **argv) {
char buffer[16];
fgets(buffer, 200, stdin);
return 0;
}
Mar!o
Unconditional jump to 64 bit stack pointer
Mar!o
But the proc is never called
Dima
lol
klimi
Mar!o
It allows to write inline assembly which is sometimes good for optimizations
Mar!o
But in the most cases the compiler does it better
Mar!o
In this case it jumps to rsp
Mar!o
Aka it sets the instruction pointer to the value at the top of the stack
Mar!o
Which better is a valid address
Mar!o
It is very unsafe to do that - jumps to labels are safer
professor
I see thanks. so basically .
if I adds __asm{jmp esp} , it will generate jmp esp gadgets for the binary itself right