Dima
professor
does anyone a group windbg specific instead of asking to stackoverflow ?
Anonymous
Hi everyone
András
can I say, that two std::any are equal or no?
Francisco
can I say, that two std::any are equal or no?
std::any doesn't have the operator==() overloaded (as far as I know), so no. Btw, you can do any_cast to get the underlined value, and compare that (if that value has operator==, of course)
Francisco
But I don't know to which type I will cast
Use typeid to get rutime information about the type
Francisco
Also, the type() function in std::any returns the typeid of the cotained value
Francisco
I don't know what are you doing, but must be weird as hell
András
As good as I understand I should do smt like std::any a = ... std::any b = ... if(a.type() == b.type() && std::any_cast<a.type()>(a) == std::any_cast<b.type()>(b))) ... but that code doesnt compile
Francisco
And type() returns a std::type_info object, which is not really what the function wants
Francisco
I'm not sure. I've never really worked with std::any. Maybe someone knows how to help you
Francisco
Btw, you can check the cppreference page for any
Francisco
https://en.cppreference.com/w/cpp/utility/any
Francisco
So how should I write it?
Don't you have like a list of possible types?
Francisco
I mean, you wouldn't handle a std::vector the same way you handle an int
András
Anonymous
there will be 2 custom classes
Well, it's better to use std::variant then, isn't it?
Anonymous
If you know which types you need to store
kappa
https://pastebin.com/h0PP47VN
kappa
line number 72(says Format specifies type 'int *' but the argument has type 'int' but the format is int type not *int)
Ilya
Then stick to Java and use the code in Java!
Ilya
I mean, why do you need C/C++ at all then?
Ilya
Fine, because C is a completely different language
Ilya
I don't see how can we help you...
olli
first of all you're leaking a lot of memory, free what you malloc. resp += s.charAt(i); is not equivalent to resp [i] = s[i];
olli
have you read my entire response? resp += s.charAt(i); is not equivalent to resp [i] = s[i];
olli
you can do char * buffer = (char *) malloc(sizeof(char)*50000); char * resp = buffer; unsigned int slen = strlen(s); for (int i = 0; i < slen; i++){ //remover tags entre < e > while(i < slen && s[i] == '<'){ for (i++; s[i] != '>'; i++); i++; } if(i < slen){ *resp++ = s[i]; } }
professor
if the following examples are memory leak because maybe we forgot to deallocate them , then how can we this help me to defeat ASLR or even better how can we dectect or view in asm level (source closed level) Object* obj = new Object(); char* pointar = new char[Number]; int* ptr = new int(5); std::vector<int> array (n); int* array = calloc(n, sizeof(int)); int* onethousand = new int[1000];
shiv
Guys i only know basic c/c++ i want to improve my coding skills help me out
shiv
Like topic wise ?
David🇨🇺ElChino
Like topic wise ?
Do you mean a book?
Talula
Like topic wise ?
What do you mean "Topic wise"? Please explain.
shiv
I mean that i want to do some practice question for every single topic
shiv
Is there any book or website ?
WHITE DEVIL
Google
shiv
Any particular website?
Anonymous
SenpaiSec
Is it visual studio?
No,its codeblocks
professor
if the following examples are memory leak because maybe we forgot to deallocate them , then how can we this help me to defeat ASLR or even better how can we dectect or view in asm level (source closed level) Object* obj = new Object(); char* pointar = new char[Number]; int* ptr = new int(5); std::vector<int> array (n); int* array = calloc(n, sizeof(int)); int* onethousand = new int[1000];
Ilya
Guys i only know basic c/c++ i want to improve my coding skills help me out
Yes, improve your coding skills, with our moral support!
Ilya
Sure, read, Google, YouTube...
No Google, no YouTube ! Only books, only cpprefereence.com
Ilya
I mean that i want to do some practice question for every single topic
Yes, on each topic you most probably will find a decent book
गणेश
गणेश
Anonymous
Is C++ used to make games?
András
yep
Anonymous
Can you tell me about some good resources to learn C++
Anonymous
I know python
german oak
I know python
python is best programming language on multiuniverse!
Anonymous
But I want to expand my knowledge
Anonymous
Anonymous
keep coding, the more the batter.
Anonymous
From Chiranjeevi: Hi guys, i am newbie in c++. How to create function object in c++ for generic datatype. I tried it butit is giving some errors. https://pastebin.com/sBYd9ZCR. The error is result_type does not name a type. I tried searching in google but i couldnt find anything useful. May be its a trivial mistake in my part. Could anyone resolve it. Thanks.
Anonymous
result_type and argument_type are not defined, Chiranjeevi
Javi
You haven't defined what are result_type and argument_type
Chiranjeevi
No, that is part of unary_function structure in c++
Chiranjeevi
I posted a pastebin link but bot keeps deleting the message
Ilya
No, that is part of unary_function structure in c++
You actually don't need these shitty function objects anymore, use LAMBDAS!
Javi
No, that is part of unary_function structure in c++
For which you need to include functional
Chiranjeevi
klimi
I posted a pastebin link but bot keeps deleting the message
Chiranjeevi Kodati: Kindly Refer this https://pastebin.com/XuRiHfC8
Ilya
I included bits/stdc++.h
Bad, this is not standard header.
Ilya
I included bits/stdc++.h
Also, don't ever do shit like this #define b begin() #define e end()
...
using namespace std;
...
dont ever do this