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
How can i declared the prime number using c++
What? Do you mean a function that tests for primality?
Aisyah
What? Do you mean a function that tests for primality?
The scenario are i need to declared the number that has been given such as 2,3,5 and etc and declared it wether it is prime number or not using function
Francisco
Ignoring your English quite sucks, what have you tried so far?
Walter
What is terminated and non terminated decimals??
Anonymous
What is terminated and non terminated decimals??
Did you even try to look on the 'net?
Anonymous
This seems like a pretty simple question to google.
Walter
This seems like a pretty simple question to google.
I wanted more technical detail like when used as float n double
Anonymous
Then why didn't you ask that question?
Anonymous
Eh, whatever.
Anonymous
Video from okenyikevin9
Dima
Bruh
Giovanni
i have a question on openMP and pipelines
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
take address
Wisenky
Still it awares
Anonymous
hi guys
Wisenky
take address
also am I on the wrong way to getting values to put them in struct
Hubert
also am I on the wrong way to getting values to put them in struct
i see some problem in your source code, first : variable block has not been declared, you just define block struct type
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
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?
MᏫᎻᎯᎷᎷᎬᎠ
How on Earth can I get current date and time as string?
Get the integers values of day, months, year and convert it to string That's all
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
klimi
i dont need complete solution... just point to right direction
https://stackoverflow.com/questions/997946/how-to-get-current-time-and-date-in-c
MᏫᎻᎯᎷᎷᎬᎠ
This could help you
klimi
https://stackoverflow.com/questions/997946/how-to-get-current-time-and-date-in-c
https://stackoverflow.com/questions/16357999/current-date-and-time-as-string
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
professor
Unconditional jump to 64 bit stack pointer
I know it , but what exactly does it? adds gadgets to the binary?
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