
please wait
by Bengbers
Reading unkown number of bytes from a non-blocking socket (1,2)
|
Hi, I am trying to learn C++ and my first project is to convert a Basex Client I wrote in R to a C++ client. From the earlier experiences, I know that I hav... |
Jan 31, 2023 at 2:45pm
[20 replies] Last: You can pass in the timeout as a parameter. You should be able to modi... (by kbw)
|
by rozick1
is this ok as a less than operator for a map?
|
I have a map of the following type: struct MyType { size_t layerPos, posInLayer, prevPos; }; std::map<MyType, string> myMap; std:... |
Jan 31, 2023 at 12:58am
[3 replies] Last: struct MyType { std::size_t layerPos = 0 ; std::size_t posInL... (by JLBorges)
|
by elon dusk
keep getting error
|
keep getting an error, not sure what im doing wrong. I'm running it on visual studio Microsoft. The main errors I'm getting is "argument of type "const char *" ... |
Jan 29, 2023 at 1:35pm
[12 replies] Last: > violating a suggested guideline It is a rule; not a mere guideline ... (by JLBorges)
|
by Ch1156
Should smart pointers be preferred over new and delete keywords?
|
Im on chapter 11.9 of learncpp and i see that its going to be teaching about using new and delete, but i heard its better to use smart pointers instead. I can u... |
Jan 28, 2023 at 7:33pm
[2 replies] Last: At least do the basics. An hour or two of your time will help a lot w... (by jonnin)
|
by Mif
length of the array of pointers, using strlen in C
|
Hello.. How do I find the length of this array of pointers? char *gCreditsEn = { "Title", "Game created by:", "Game Design:", "Music by:", "... |
Jan 28, 2023 at 5:23pm
[16 replies] Last: Sure, but strlen expresses intent better. (by Ganado)
|
by anup30
print the content of your program's source file to console, without user inputting the file name or giving it in source.
|
print the content of your program's source file to console, without user inputting the file name or giving it in source. the main problem here is getting the... |
Jan 26, 2023 at 7:34pm
[11 replies] Last: If it had ^^ instead of ^^^ teeth I would a vampire but I hope JLBorge... (by malibor)
|
by Dakiller
Why is cin not working after loop?
|
Hi everyone! so I have an issue I cannot figure out, basically when I simulate eof using ctrl + d the second use of cin is never used and skipped over, I have a... |
Jan 26, 2023 at 10:05am
[3 replies] Last: Thanks seeplus for the help with this! I really like the idea of using... (by Dakiller)
|
by Peter87
Be careful when storing the result of std::clamp as a reference
|
Earlier, someone posted a question about std::clamp but the thread was removed before I had a chance to respond (probably because the OP realized his mistake). ... |
Jan 25, 2023 at 9:08am
[12 replies] Last: Some structs are PODs. (by Peter87)
|
by Jonathan100
Stack frame error
|
Hi. I ask couple of days ago about unexplained code behavior. It hasn't been solved completely. I now have some more specific details about that. Function In... |
Jan 24, 2023 at 11:10am
[15 replies] Last: Hi folks. I have an update about the issue. in sitalDevice_Initialize... (by Jonathan100)
|
by ElusiveTau
Was std::set suppose to model mathematical sets?
|
I apologize in advance. This reads like a half-rant/half-question trying to understand why C++ was designed a certain way. std::set seems redundant and beha... |
Jan 23, 2023 at 10:02pm
[5 replies] Last: It depends on your perspective, I suppose. in short to the above, no... (by jonnin)
|
by mathman54
Looking for guidance on writing desktop apps
|
Hi People, I want to write some desktop apps. I have some good ideas. However, I have become very aggravated with current book offerings. I have 2 books on C++.... |
Jan 22, 2023 at 1:27pm
[11 replies] Last: > I also do not have a problem with learning C# and .net. >> I would ... (by JLBorges)
|
by bydrachen
Finding Vector(includes objects) Element's Index by Element
|
I'm trying to find the index of a vector element. Vector includes class objects. But I can't find a way. #include <vector> #include <algorithm> #include... |
Jan 21, 2023 at 12:51pm
[2 replies] Last: Perhaps this: #include <vector> #include <algorithm> #include <iost... (by seeplus)
|
by Shervan360
Size of Union and Struct
|
Hello, I want to calculate the size of struct and union. Is the below true? In the union, the output is 20, I expected being 24 (20 is size and 4 for paddin... |
Jan 20, 2023 at 5:59pm
[14 replies] Last: Worth noting that standard C++ has alignas for controlling alignment... (by mbozzi)
|
by PhysicsIsFun
Inheritance and virtual functions
|
Greetings! I try to understand the role of the virtual keyword when changing the signature of a member function in a derived class compared to a base class (I ... |
Jan 19, 2023 at 6:19pm
[9 replies] Last: Thank you guys! (by PhysicsIsFun)
|
by robjs111
Returning wrong value
|
Write your question here. In function Sum why is program returning an 8 in sizeof(A) instead of 4? Int*P points to first element in array A which is an inte... |
Jan 15, 2023 at 12:33am
[8 replies] Last: For typical values, std::ptrdiff_t can be used as signed std::size_... (by JLBorges)
|
by Ch1156
How to output a map from a class with operator overloading (1,2,3,4)
|
So im trying to output the contents of a map from the class and i obviously have to overload the << operator to do so but i cant seem to figure out what im dong... |
Jan 14, 2023 at 6:03pm
[77 replies] Last: Yow, that there is one mouthful. (by deleted account xyzzy)
|
by Shervan360
How Can I Initialize this Dynamic array?
|
Hello, How Can I Initialize this Dynamic array? I'd like to have pointer to an array with size n int *arr #include<iostream> using namespace s... |
Jan 14, 2023 at 4:48pm
[3 replies] Last: If you are wanting to have a dynamic array why bother with pointers, e... (by deleted account xyzzy)
|
by rozick1
can i declare an iterator outside of the container class?
|
Hi I have created a container class for which I need to create a bespoke iterator (not merely exposing the iterator of the container's internal data type). ... |
Jan 14, 2023 at 11:58am
[1 reply] : > I find the container class becomes somewhat cluttered > as the decl... (by JLBorges)
|
by StMick
Cannot access vector[0] index
|
Hello! Any advice on the code below would be appreciated. I keep getting a segmentation fault stating "cannot access memory at address ..." where it is ... |
Jan 13, 2023 at 5:21pm
[5 replies] Last: Consider (when v is sorted ascending): #include <vector> #include <... (by seeplus)
|
by Jonathan100
code unexplained behavior (1,2)
|
Hi guys. I work with some exotic hw design [microblaze + ddr], which upon I build sw which consists of many .cpp and .h files. At some point i encounter unexp... |
Jan 13, 2023 at 3:54pm
[23 replies] Last: [quote=Peter87]Well, we do see that there are sitalMaximum_DEVICES num... (by lastchance)
|