Artöm
You clearly has std::set or another std::map somewhere
#39424E
That's right, my bug
Sorry, forgot the line:
it_thread_ids = thread_ids.find(id_thread_to_remove);
thanks for the help)
Artöm
It does for compilers (stdlibs) one usually cares of
Manish
I am little bit confuse about std::unique_ptr<MockHealthCheckEventLogger> event_logger_{std::make_unique<MockHealthCheckEventLogger>()}; Can anyone help me understand that? Thanks!
Artöm
Glad to hear that
Anonymous
Why can't he just malloc and then realloc as needed?
Hermann
i have char* dimarray="dimarr", how pass it to array, myarra[dimarray], without stack error variable?
Dima
lol
Anonymous
Anonymous
Or strcpy it into an array of a sane size?
Manish
Way to initialize smart at the declaration. sometimes I have seen using = operator and here {}. these things make confusion.
Manish
Thanks.
杰森 😴
hello
Hermann
i try with malloc, by i get stack protector not protecting local variables: variable length buffer
Hermann
-fstack-protector -fstack-protector-all
Hermann
same result
Hermann
i edit code, i dont get waning...why i use protector-strong instead protect-all
Hermann
cant i use protector-all?
Hermann
so...protect-all is better...i dont understand stack's warning
Rakshit
Hey everyone.
I want some advice regarding studying Data Structures and Algorithms for preparing for FANG companies' interviews for Software Engineering roles.
What framework/flow would you advise me to follow to maximize my learning experience in a time span of 3 months?
Thanks!
Rakshit
Hermann
ok...but in my function i use only one array...why with protect-all i get warning?
Hermann
are other variables wrong?
𓆉 𝖙𝖚𝖗𝖙𝖑𝖊𝕶𝖎𝖓𝖌 ࿐
How to prevent someone entering wrong value in c? because if someone enters digits in place of char then program stops working.
Hermann
thanks:)
Anonymous
Anonymous
Just use -fstack-protector-all
Anonymous
Don't add the other flag
Anonymous
And also
Hermann
Anonymous
Anonymous
Use something actually designed to find these
#39424E
Again the problem with a map<>:
map<int, DWORD> thread_ids;
map<int, DWORD>::iterator it_thread_ids;
for (i = 0; i < threads_count; i++)
{
int currentThreadid = 0;
tmp_id_thread++;
ghThreads[i] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)marker, &thread_ids, 0, &dwThreadID);
currentThreadid = GetThreadId(ghThreads[i]);
thread_ids.insert(std::pair<int, DWORD>(tmp_id_thread, currentThreadid));
}
When deleting an item:
for (it_thread_ids = thread_ids.begin(); it_thread_ids != thread_ids.end(); it_thread_ids++)
{
if (it_thread_ids->second == id_thread_to_remove)
{
thread_ids.erase(it_thread_ids);
}
}
"Expression: map/set iterators incompatible"
Anonymous
You need asan and boundsan
Dima
Anonymous
For clang -fno-sanitize-recover=bounds
for gcc -fsanitize=bounds-strict
Dima
/warn assignment request on join, read the rules
Wisenky
sure
Wisenky
typedef struct
{
int studNum;
students *stud;
char facultyName[100];
}faculty;
typedef struct
{
int facultyNum;
faculty *faculty;
char *name;
}university;
Wisenky
I am student and sorry for my awkwardness
Anonymous
If he using C the cast is not necessary
Wisenky
but I need more than 1 faculties , for example if I put my students in electronics its uni->(faculty+0) and architecting uni->(faculty+1) etc ?
Anonymous
Meh
Writing C like code in C++ is a mess
Wisenky
oh I'll try now
Wisenky
for(i=0;i<uni->facultyNum;i++)
{
printf("\n%s",uni->faculty[i]->facultyName);
}
then
[Error] base operand of '->' has non-pointer type 'faculty'
I couldnt access
Wisenky
Wisenky
Wisenky
okay I'll try
Wisenky
doesnt work
Wisenky
oh thanks
Wisenky
unable to access site
Wisenky
okay this not
Wisenky
Im trying to paste my cod to it
Hermann
Anonymous
Erkin
Hello everyone, I learn c and l think I am intermediate( I can use pointers, functions and file handling). So many people around me say me I must learn c++ because in real life c++ more effective for make money. What I should do?
Anonymous
Anonymous
Anonymous
Nils
Anonymous
C++ is much nicer language when you understand its philosophy
Anonymous
Erkin
Anonymous
Anonymous
There are only 3 sanitizers that you can ship in production
Anonymous
And address sanitizer is not in the list
Wisenky
https://hastebin.com/sigikezane.cpp
AnonSociety
Thank you so much
6Yy6Q1111q111otlrlrrkowowoowowooo9o7pllopŞEerhhh
ojjhhhh
uhjuduuueuerkrkjerrjrj
Jhdpofjfbnkkkdko
MᏫᎻᎯᎷᎷᎬᎠ
I'm gonna ask a lot of stupid questions from now on
Wisenky
https://hastebin.com/uwiledoyen.cpp now it brings me [Error] base operand of '->' has non-pointer type 'faculty' for all uni->fac[i]-> etc etc lines