\Device\NUL
The /O3 effect is same with /Os which prefer size than speed
Anonymous
who made trading app?
Ammar
I just took a look here: https://learn.microsoft.com/en-us/cpp/build/reference/o-options-optimize-code?view=msvc-170
Ammar
So the best performance is /O2 for mscv, not /O3.
Chat Boss
How to get it sent a huge message, it has been re-uploaded as a file # compile program #include <stdio.h> #define true 1 #define false 0 struct bTREE{ int height ; int left; int right;..
the best for everyone
How to get it sent a huge message, it has been re-uploaded as a file # compile program #include <stdio.h> #define true 1 #define false 0 struct bTREE{ int height ; int left; int right;..
// If the root address of binary search tree // is taken as a parameter and the tree is AVL (balanced) //Write a function that returns false if not true
Kriss
i want to reverse a string but my function is not giving any output
Chat Boss
Kriss Ny sent a code, it has been re-uploaded as a file
Pavel
i want to reverse a string but my function is not giving any output
You need to resize your string s for the amount of elements
Anonymous
can anyone tell me what is the error
You are storing the left and the right subtree as an int and then casting them to a bTREE pointer. This is UB to begin with. And moreover on a 64 bit machine, ints will be 32 bits long and pointers will be 64 bits long. This would not even work. Why not work directly with bTREE pointers instead? Fix all these issues and then come back here if you still have problems.
Anonymous
why i can't send photos
Because we are not keen on seeing your photos
Pavel
why i can't send photos
If you want to send code, use pastebin, if you want to send error messages, use pastebin. If you want to share a photo of your display, please don't
Anonymous
Hi folks , I need to take a university exam on c programming . The professor asked to bring an elaborate and I had thought of bringing a small archive built with the use of lists, file management, etc... If you have one ready I would be very grateful to see it to get an idea. Thanks in advance
M
The times.txt document is a 20-line file with hours:minutes:seconds per line. is a document. By reading this document, you create the always-existing data structure By assigning it to instances of its type, it will increment by 1 sec and print that increased time in a new document write the code. If the time format is misspelled, the user should be warned by skipping that line.
𝑴
Does C language utilize short circuit evaluation?
Ar
(int)1.0 vs int(1.0) what is the difference 🤔
Anonymous
(int)1.0 vs int(1.0) what is the difference 🤔
No difference. They are the same for your case. The first one is a C-style cast and the second one is a functional style cast. The second cast will usually make a difference when the expression is slightly more complicated than what you have here.
Anonymous
int() is the constructor
C++ is not Java/Ruby. int is not a class.
布丁
typename class no difference la
布丁
struct class same thing
Egro
anyone have github with their c++ project posted ?
Anonymous
typename class no difference la
Who are you replying to?
布丁
Who are you replying to?
https://t.me/programminginc/485000
Anonymous
typename class no difference la
There are minor differences between a struct and a class. int is definitely not a class. It is a built-in type.
布丁
Class? Built-in type? No difference leh
Anonymous
Class? Built-in type? No difference leh
Yes there are. All built in type objects can be trivially constructed and copied. Not all class type instances can be trivially copied and constructed.
Anonymous
Can a class type be trivially copied and constructed?
Only if they are specifically designed for it.
布丁
If yes, then that’s all.
布丁
No
So you mean "no instances of class types can be trivially copied and constructed"?
Anonymous
So you mean "no instances of class types can be trivially copied and constructed"?
I said only specifically designed ones can be trivially copied and constructed. For ex std::string is not trivially copyable. Built in types are specifically different from class types because the rules to handle them are specifically built into the compiler. The rules to handle classes are generic and not built in. Most of the optimizations that the compiler can do on a built in type are coded into the compiler (meaning the compiler can see a lot about them) while the ones that can be done on a class type instance are rule based learnings. So in effect built in types are different from compound types or user defined types. There is a reason why they are called built in types. That is the reason why no one will call int(1.0) a constructor call. It is called a functional cast. While on the other hand std::string("hello") would usually be considered as an invocation of a constructor .
布丁
Btw int is also a primitive in Java, where primitives and classes really have differences
Anonymous
Regarding optimization, there shouldn’t be any differences otherwise all the "zero-cost abstraction" effort will break. (Actually it already breaks but it’s a different story) From a users perspective, one can simply treat built-in types and custom types as the same. There is really no point distinguishing them.
<quote>--Regarding optimization, there shouldn’t be any differences otherwise all the "zero-cost abstraction" effort will break. (Actually it already breaks but it’s a different story)--</quote> I wasn't saying there is a difference in the optimization. I am saying there is a difference in the way it is carried out. And btw there are indeed optimizations that can be immediately visible on a built in type that may not be so for a User Defined Type. For example on an architecture where operations on an long long can be carried out atomically without a lock, a compiler would certainly be able to enforce this atomicity on all operations on long long objects. But on the same architecture if a User Defined type say A that measured out to be the same size as that of a long long, the compiler can't guarantee that operations on std::atomic<A> would be lock free. So yes there are some differences. <quote>--From a users perspective, one can simply treat built-in types and custom types as the same. There is really no point distinguishing them.--</quote> This I agree with on a superficial level.
Anonymous
Btw int is also a primitive in Java, where primitives and classes really have differences
I meant the boxed type in Java. And in some languages like Ruby etc you can consider int to be equivalent to a User Defined Type with their own methods. They are all classes to begin with
Anonymous
The atomic example is an implementation thing, not related to optimization. Consider std::vector<bool> where it doesn’t make sense to say bool has anything special from that.
Optimizations in general are implementation specific barring a few cases like RVO or NRVO that the standard specifies or explicitly requires.
Anonymous
The atomic example is an implementation thing, not related to optimization. Consider std::vector<bool> where it doesn’t make sense to say bool has anything special from that.
For vector<bool> the standard specifically allows for its optimization and infact mentions a reference_type as the return type of methods that are required to return a reference to return instead a different reference type that can be converted to bool implicitly
Anonymous
The atomic example is an implementation thing, not related to optimization. Consider std::vector<bool> where it doesn’t make sense to say bool has anything special from that.
And I was always talking about the difference between built in types and user defined types from a compiler's perspective. So why suddenly are you changing track?
布丁
I didn’t mention user-defined types anywhere 😂
Anonymous
Class? Built-in type? No difference leh
What is class here? They are called User Defined Types
布丁
Alright, different tracks all the way down 😂
Anonymous
Alright, different tracks all the way down 😂
I was clear from the beginning on what I meant. You were just clearly confused on what was being said and went down a rabbit hole.
а
Bruh
Anonymous
Bruh
Let us not discuss anything unrelated to C++. So unless you have something C/C++ specific to say, take your discussion to the OT group.
Anonymous
Well I admit I’m confused when you start to mention User-Defined Types
All class types are User Defined Types. Doesn't matter if it is explicitly defined by a user or by the standard library.
布丁
All class types are User Defined Types. Doesn't matter if it is explicitly defined by a user or by the standard library.
I just checked the reference that you are correct. I think next time you can just throw out std::is_fundamental and end the discussion.
Anonymous
I just checked the reference that you are correct. I think next time you can just throw out std::is_fundamental and end the discussion.
Finally you agree. If I had said you can use built in types without including any headers while, for a class type you usually have to include a header, would you have accepted it as a valid difference to distinguish between built in types and class types? I don't think so. Likewise using std::is_fundamental as an argument would not have helped either. That is the reason why I mentioned that built in types are supported intrinsically by the compiler unlike the class types which would appear to be a more valid argument.
布丁
Think of it in another way - what if the built-in types are also classes with some compiler magic?
Francisco
How do I create an interface for my app in c or c++
Pavel
How do I create an interface for my app in c or c++
By interface you mean API, GUI or CLI?
布丁
GUI
Which platform you are targeting
Francisco
Or at least an API for it to resemble a normal app in playstore like Kawlo or Photomath
Pavel
GUI
You can use one of GUI frameworks, many people use Qt (but check the license of the version you're going to use to make sure it fits your project). There are also wxWidgets that are more low level. And there are things like SDL2 which just give you window and opengl context and you can write a gui framework from scratch based on them.
Francisco
Can you create an OS from scratch sing c++
Francisco
*using
Pavel
Or at least an API for it to resemble a normal app in playstore like Kawlo or Photomath
If you want to write android app you can write GUI using native tools in Java and then connect the C++ logic to it (but it will probably require extra work if you want iOS also)
Pavel
Hema Hariharan
😞 i thought i could help some one