Dima
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)
András
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
Francisco
And type() returns a std::type_info object, which is not really what the function wants
András
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
I mean, you wouldn't handle a std::vector the same way you handle an int
András
Anonymous
If you know which types you need to store
András
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)
kappa
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
Talula
shiv
Like topic wise ?
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
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];
Anonymous
Ilya
Ilya
गणेश
गणेश
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
Anonymous
But I want to expand my knowledge
Anonymous
Anonymous
Ilya
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
Tokin
Javi
Anonymous
Ilya
Chiranjeevi
Ilya
...
using namespace std;
...
dont ever do this