/
mbedtls_cipher_set_padding_mode
/
klimi
do you know what is it for
Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocols.
/
/
klimi
klimi
I think all the details are on the README.md
aslam
Amigo Eletrônica
hey guys, a dude coming from Python language, very used to Python console for testing code, methods etc. What do you suggest me for these kind of debuggingg and testing when coding in C++?
As I'm unitiated to C++, I'm still unaware of its workflow on this matter
Artur
Linux, perhaps Ubuntu 22.04, Visual Srudii Code, gcc that’s all you need to get started
Artur
You will be able to debug/print stuff into the terminal of visual studio code as long as you execute the program from there
Artur
You kinda could using gdb
Artur
But why ?
Amigo Eletrônica
like run one like of cpp code and get its output
Amigo Eletrônica
But why ?
sometimes you're a bit unsure of a specific snippet and instead of adding it to your whole code, you'd like to test it separetely with different inputs to analyse other potential outputs
Artur
Well write a unit test then
Artur
Python project development != c++ project development
Talula
Dev.🐍
Hi
How i can pass or ignore ssl certificate with cpr library?
Scriptern
!res
klimi
aslam
I am trying to run a code given to me by my colleague and it has some parallelization done in the code. In the code it uses the omp_set_max_active_levels function as well. I have omp.h file include yet this function is not recognized and instead throws identifier not defined error. I checked omp.h file and such a function is not declared there to my surprise. But the documentation has this function as can be seen here https://www.openmp.org/spec-html/5.0/openmpsu125.html#x162-7300003.2.16. Where do you think is the problem?
Tazin
#include<iostream>
using namespace std;
class animal
{
private:
int leg, wings, horn;
public:
string species, blood;
void setData(int l, int w,int h);
void getData(){
cout<<"The name of the species is "<<species<<endl;
cout<<"The temparature of it's blood is "<<blood<<endl;
cout<<"It has "<<leg<< " legs "<<endl;
cout<<"It has "<<wings<< " wings"<<endl;
cout<<"It has "<<horn<<" horns"<<endl;
}
};
void animal:: setData(int l, int w, int h){
l=leg;
w=wings;
h=horn;
}
int main(){
animal cow;
cow.setData(4, 0, 2);
cow.species="Mammalia";
cow.blood="cold";
cow.getData();
return 0;
}
Tazin
hey guys can you check my code if i made any mistakes
Tazin
whenever i run code the output is this -
Tazin
The name of the species is Mammalia
The temparature of it's blood is cold
It has 4199136 legs
It has 4199136 wings
It has 0 horns
neovstan
#include<iostream>
using namespace std;
class animal
{
private:
int leg, wings, horn;
public:
string species, blood;
void setData(int l, int w,int h);
void getData(){
cout<<"The name of the species is "<<species<<endl;
cout<<"The temparature of it's blood is "<<blood<<endl;
cout<<"It has "<<leg<< " legs "<<endl;
cout<<"It has "<<wings<< " wings"<<endl;
cout<<"It has "<<horn<<" horns"<<endl;
}
};
void animal:: setData(int l, int w, int h){
l=leg;
w=wings;
h=horn;
}
int main(){
animal cow;
cow.setData(4, 0, 2);
cow.species="Mammalia";
cow.blood="cold";
cow.getData();
return 0;
}
Damn. In function setData you l=leg, w=wings, but should be leg=l, wings=w
Tazin
Thanksssss so much
Ольга
https://onlinegdb.com/lCSbYaVh_
Good afternoon, I will be very grateful if someone can explain to me why my dobutok function is not working correctly. Really very urgently needed
Ольга
Gianmarco
i'm trying to execute a program (just a simulation of tic-tac-toe) and it gives me the following error:"Thread 1: EXC_BAD_ACCESS (code=1, address=0x16fe00000)". i'm on a macos laptop, and i already updated it to the latest software update, i tried to find something on the internet about it and i just found (vaguely) that my code could take too much space(it's about 100 lines long). i would attach a picture but the group doesn't let me do it. (programming in C)
UrCodeBuddy️ 💻
its a pointer error
UrCodeBuddy️ 💻
ur accessing some file which you arent supposed to
Frans
Hi, how do i get the line that starts with a * in regex
abs(Faisal)
Is C++ the most prominent language in competitive programming? Or is it the only one?
Frans
Unk
Hi, what is the Problem of
while (cin >> num)
{
…
}
terminate by input
Jonathan
ctrl+z
UrmuGölü
Anonymous
\*.* ?
If you want to match an entire line beginning with atleast one asterisk, you should use the regex
"^\*+.*$"
Yui
https://godbolt.org/z/KGofeTzns why I can't implement like this?
Yui
🥲
Jonathan
derived is u current class name
Yui
even if accessor inherite from Derived, I can't access via Base?
Jonathan
template <typename t>
struct derived :base<T>
Yui
more concrete?
Anonymous
https://godbolt.org/z/KGofeTzns why I can't implement like this?
This stems from your misunderstanding of inheritance. A derived class has access to the base class parts of it's base class subobject. This does not mean it can access the protected parts of any A object.
For example assume there is a base class A with a protected member 'data'. If there are two publically derived classes B and C, then members of B can access only the protected members of A within its subobject. They can't cast a C object to an A object reference and then access 'data' member within it. That would be forbidden by the compiler.
This is precisely what is happening in your code as well. You are trying to get a member function pointer to a member function in DerivedT. Though accessor derives from DerivedT, this does not access the DerivedT subobject within accessor. This is a independent access and is hence flagged as an error by the compiler.
Yui
Yui
yeah, I am confused about it for hours, it's weird...
Yui
Now I got it
Yui
thanks!
Yui
Yui
msvc v19, it works fine
Frans
Jack 3
Anonymous
Hi i'm new here
Frans
UrCodeBuddy️ 💻
When ur defining an array or list, normally how it works it, it stores the first value for eg if I have int var[10]; what it means is it takes are address of var[0] stores it...and then creates a storage of 10 attached to var[0].
Now segmentation error mostly occurs when u disturb the data, or the addresses. It doesn't only happen because of lists. But mainly this reason
Yui
https://godbolt.org/z/fYxb3as38 I know, I've tried already.
Anonymous
msvc v19, it works fine
Msvc is a decent compiler in that it supports more standard library features and core language features than GCC and Clang. But they are also known to allow extra features that are prohibited by the standard. Both GCC and Clang do so as well but they give you the options to treat them as extensions which you can enable or disable.
For ex in C++17, you can't capture a structured binding variable in a lambda by value. You have to use init capture to capture such a variable. But MSVC allows you to do so and doesn't flag it as an error. Clang doesn't. GCC allows it as an extension which can be turned off if you want strict standard compliance.
Yui
takes the holes as feature?😑
Pavel
Anonymous
Hi,
An exercise asks to define
char *strjoin(int size, char **strs, char *sep);
so that
• if size is 0, you must return an empty string that you can free().
What does it mean by ability of free(). When we can free and can't.
Anonymous
In the answer of the exercise, it is written:
if (size == 0)
return ((char *)malloc(sizeof(char)));
what if we return (0)
klimi
Антон
klimi
Pavel