/
mbedtls_cipher_set_padding_mode
klimi
someone know what is mbedtls
https://github.com/Mbed-TLS/mbedtls
/
https://github.com/Mbed-TLS/mbedtls
yes but i didnt understanded what it does
/
https://github.com/Mbed-TLS/mbedtls
do you know what is it for
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
what does it mean
what exactly? it's quite good description.
klimi
is it like to encrypt things
yes. you could do that
klimi
I think all the details are on the README.md
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
Amigo Eletrônica
You will be able to debug/print stuff into the terminal of visual studio code as long as you execute the program from there
but i'll print stuff after running the whole programm,right? I mean, isn't there a way to run Cpp code as if it were interpreted?
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
Amigo Eletrônica
Python project development != c++ project development
yep, that's what I'm trying to grasp properly :)
Amigo Eletrônica
Python project development != c++ project development
in the c++ project development workflow, what's the best way keep watching variables values and functions outputs while programm is running?
Talula
in the c++ project development workflow, what's the best way keep watching variables values and functions outputs while programm is running?
https://devblogs.microsoft.com/devops/7-ways-to-look-at-the-values-of-variables-while-debugging-in-visual-studio/
Dev.🐍
Hi How i can pass or ignore ssl certificate with cpr library?
Scriptern
!res
klimi
!res
@Resources
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
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
Konstantin
I don't understand why this not movenext
Seems something wrong with first/last pointeers. Implement print function for your list and check the access to the elements you added. Check the navigation.
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?
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.
Anonymous
so the example code of this wikipedia(CN site) is wrong= =https://zh.wikipedia.org/wiki/%E5%A5%87%E5%BC%82%E9%80%92%E5%BD%92%E6%A8%A1%E6%9D%BF%E6%A8%A1%E5%BC%8F
If it is the same code as the one you shared earlier, then it is definitely wrong. Try changing the protected access specifier to public. You will see that it works fine. I don't know why that Chinese site is teaching your CRTP in such a roundabout manner and also in the wrong way. CRTP is just a way to simulate polymorphism at compile time where the compiler will call the correct method in the derived class without the overhead of a vtable and stuff.
Yui
yeah, I am confused about it for hours, it's weird...
Yui
Now I got it
Yui
thanks!
Yui
msvc v19, it works fine
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
Anonymous
msvc v19, it works fine
It is not standard compliant. GCC and Clang both reject this.
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?😑
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
In the answer of the exercise, it is written: if (size == 0) return ((char *)malloc(sizeof(char))); what if we return (0)
you cannot call free(0); because that is invalid pointer (and it haven't even been allocated with malloc)
Антон
you cannot call free(0); because that is invalid pointer (and it haven't even been allocated with malloc)
Nope, C standard explicitly says that calling free with NULL is fine and does nothing
klimi
Nope, C standard explicitly says that calling free with NULL is fine and does nothing
yeah, you are right; but only with NULL, not (in all cases) 0...
Anonymous
In case of capturing structured bindings I'm on the GCC side or at least MSVC, afaik it was basically a bug in the standard
Doesn't matter what you or I desire. Standard is the last word and strict compliance with it is necessary. You can extend the standard as long as you give people a way to disable those extensions. MSVC didn't do this which is wrong. It has been fixed in C++20.
Anonymous
Well, yes but there's also common sense, if you make something that is by the paper but that will only add more suffering to everyone.. will it be better?
Is that better than avoiding portability? What if one compiler supports it and another doesn't? Where is the common sense in supporting non portable code?
Pavel
Is that better than avoiding portability? What if one compiler supports it and another doesn't? Where is the common sense in supporting non portable code?
Well in my case I don't use clang (just because of this one problem, because I don't want to uglify my code). In generic case you would need to build your code on three major compilers anyway before submitting it to the codebase, if you care about portability, because there's always something broken between compilers anyway (intentionally or not).