Danya🔥
my personal method is to set a project (something like make a simple database) and try to use as many new things as i can some times i stuck in some topics to learn more about them
It's a good strategy. It'd be better if you found someone who could review your code while you work in the project.
Danya🔥
i only have chat gpt :)
Better than nothing yet not as great as a professional
John
admin please, you should allow sharing of C/C++ books here in .epub and .pdf only format
John
No, pirating is bad
ooops, got it
Sherlock
how to install a specefic version of c++
Pavel
how to install a specefic version of c++
You can have the latest version installed and enable a previous version using compilation flags E.g. for GCC or clang you can run compilation with -std=c++11 to use C++11 version.
Sherlock
No DMs please, can you share here?
pics not allowed thats why
Anonymous
I have a function which has std span as an argument. I want to do the following: to call this function in another function which takes pointer as an argument and pass this pointer to the span. Is it right way?
The
Hello
The
1st year college student here I'm kinda Hoping to learn C++ I have no prior knowledge does anyone have a file or something so I can learn something Thanksm
Aditya☺️
Sherlock
You can get tutorials for each and every question they have on YouTube do that you can refer them whenever you get stuck
Davide
Hi guys. I have a class with a private attribute. I want to access it using an other class but I don't want to modify the "base class" file, changing the attribute to public. Is there something I can do?
Anonymous
I have a function which has std span as an argument. I want to do the following: to call this function in another function which takes pointer as an argument and pass this pointer to the span. Is it right way?
Yes you can call a function that expects a span with a pointer provided you know the extent of the pointer. There is a specific constructor for this purpose. A span is more than a pointer. It is a pointer with an extent i.e. the area of coverage of the pointer. This can be a compile time value in which case it is baked in and the extent need not be stored separately. In the case the extent is known only at runtime, then the span can be thought of as a pointer with a numeric value that tells it the number of elements it points to (this is just for udnerstanding purposes. A span can be implemented in other ways too).
Anonymous
Hi guys. I have a class with a private attribute. I want to access it using an other class but I don't want to modify the "base class" file, changing the attribute to public. Is there something I can do?
"friend" is your friend. But it may not be apt for your use case. Unless we see your code, there is not much that can be offered in way of help.
Davide
"friend" is your friend. But it may not be apt for your use case. Unless we see your code, there is not much that can be offered in way of help.
The code is pretty big. When I have the time I try to do a reproducible example. Anyway I have something like: baseClass.cpp class private: int myData I want to access myData from the main.cpp file without changing any line in the baseClass.cpp. I thought about "friend" but it has to be written inside the baseClass. As far as I know, there is no "standard" way to do something like that. Can you confirm that? Thank's for your help!
21CD030087.
hi has any one tried writing c++ code for divided difference?
Davide
Nopes. There is no way then to do what you expect unless you want to do compiler and architecture specific tricks (by working on the layout on a specific architecture). In other words, there is no standard compliant way to do this.
Ok! The fact is that I'm writing an extension of a big framework and in order to have a clean and organized distribution I don't want that the user, to make my extension work, would need to edit some file of the framework. Thank's 😁
Saeed
Hi How can I implement function to add positive and negative numbers in bitwise? I googled a lot but no results
Ziky
Bitwise
do you have any example?
Arthur
Hi How can I implement function to add positive and negative numbers in bitwise? I googled a lot but no results
Why can't you just use bitwise or? And what should be the answer for -1 bitwise add +1?
artemetra 🇺🇦
look up half adder and adder
https://en.wikipedia.org/wiki/Adder_(electronics)
Leovan
As you probably know we can't compare two floats just using == operator. Instead of this popular solution is to find module of difference between floats and compare it to some small epsilon value: if (std::abs(x - y) < epsilon) ... But I'm interested if comparison like that would work: if we just round up floats to several decimal places, for example 0.20000007 firstly round up to 0.2 and then compare with 0.2 using == operator? And how much worse it is in comparison with the module?
Danya🔥
The reason is the same
Anonymous
As you probably know we can't compare two floats just using == operator. Instead of this popular solution is to find module of difference between floats and compare it to some small epsilon value: if (std::abs(x - y) < epsilon) ... But I'm interested if comparison like that would work: if we just round up floats to several decimal places, for example 0.20000007 firstly round up to 0.2 and then compare with 0.2 using == operator? And how much worse it is in comparison with the module?
What do you mean by round up? A value like 0.1 cannot be stored exactly. The representation may be something like 0.100000937. The very act of rounding itself doesn't work as you think it does. It is also an approximation. If you find yourself in the situation of comparing floating point numbers and you require precise calculations and can't tolerate even epsilon differences, then you should be using a fixed point decimal.
Mahdiy
I'm new in C++. What could I use to link external libraries? What is better to use? Thanks.
Danya🔥
Lol
Ziky
I'm new in C++. What could I use to link external libraries? What is better to use? Thanks.
https://csgeekshub.com/wp-content/uploads/2020/07/C-Program-compilation-steps-and-process.jpg
Mahdiy
What do you want to do ?
I need to integrate my project with libreoffice API. So it has a choice of cmake or linker. I don't know what is prefer.
Mahdiy
My second question is: Are there any libreoffice libraries for beginners? libreoffice is little hard to understand to me. :)
Mahdiy
I think the linker is the best
I will try. Thank you.
Danya🔥
I need to integrate my project with libreoffice API. So it has a choice of cmake or linker. I don't know what is prefer.
> So it has a choice of cmake or linker This is nonsense "cmake" and "linker" are very different things and you cannot choose one OR another
Mahdiy
> So it has a choice of cmake or linker This is nonsense "cmake" and "linker" are very different things and you cannot choose one OR another
Maybe I was wrong. What did I think: g++ -L /some_library_dir Or target_link_libraries( some_library ) Maybe I mislead.
Ziky
the second one is just specification for cmake build system which then calls likner with desired argument according depedencies you specified
Rain Bow
Can anyone check my coding im want my coding like this if i pressed the switch the led will be stop running but when im run my program and click a switch led is still running
User
Hii folks, I'm a Python developer and intrested on c++ so just suggest me how can I start learning on c++
Apk
This is an English group.
Ziky
Hii folks, I'm a Python developer and intrested on c++ so just suggest me how can I start learning on c++
To be honest I would scream a run fast... But if you instist pick and ide (ideally the one you are familiar with) find. Hello world tutorial using that ide, make it work on your pc (even this might not be trivial) then learn hot to debug it. And then try to print elements of an array. If you are not screaming now try to reverse array and then you will be...
deploy⁶⁹🍞🎀
How can I encrypt/obfuscate C++ code? I threw my program compiled in C ++ into HxD and there was a lot of very important information from the code. Maybe there is some program that obfuscates the code, I don't know.
Guillermo
I don't understand what you mean with "a lot if very important information from the code"
Guillermo
you could do what Danya told you. You optionally could strip the symbol table so that symbols does not appear in the binary
Guillermo
Probably debug info
yeah. But anyway, Ida or any software able to do reverse engineering over the executable could create C/C++ code based on the binary even if there is no Symbol Table in the binary
кар карыч
Probably debug info
he is talking about strings with some keys that will be visible in ghidra
Dima
We have a mind reader right here
I hope it doesnt read everything directly to ram
кар карыч
We have a mind reader right here
I talked with him in PM)
Light
In a circular queue if Front = 4 Rear = 5 Queue: NULL, A, NULL, NULL, NULL, F If I want to enqueue X,Y,Z here what will happen?
li
rear–front=1 means the queue is full , right?
Light
no it is circular queue
li
so it is empty right?
Light
so it is empty right?
This is the Queue NULL, A, NULL, NULL, NULL, F it is not empty
Pavel
rear–front=1 means the queue is full , right?
Since rear is the last (not one after the last) element and front is the first, then rear - front + 1 = 2 - number of elements in the queue (this formula doesn't consider the case when front bigger than rear)
Anonymous
im currently reading the "c programming language" and at task 2-6 to write the setbits function i end up with that, unsigned setbits(int x, int p, int n ,int y){ int temp = getbits(y, p, n); x = x >> n; x = x << n; return x | temp; } but it seem to not working and i coulnd find the bug, do someone can explain to me better what i am missing over here? :(