Beginners - October 2020 (Page 12)

Confused with adding fractions
 
Instructions are: implement a simple class called the Rational class that can used to represent fractions. These objects hold an integer values that may be be ...
[6 replies] Last: Any reasoning for being private? (curiosity...) None that's very goo... (by dhayden)
by TLoke
Reading & Printing Unicode / UTF-8 Mac
 
Hi all, long-time-lurker but 1st-time-poster here, I recently took a dive back into Unicode while trying to research old computer graphics, and quickly found my...
[11 replies] Last: ...0x2593 is only 2 bytes... sorry, the leading zeros must be hidden[b... (by TLoke)
What does "moving contents" in the use of std::move() mean?
 
Below is example code from . std::string foo = "foo-string"; std::string bar = "bar-string"; std::vector<std::string> myvector; myvector.push_back(foo); ...
[4 replies] Last: [quote=mbozzi]The temporary object's lifetime is the same as the full-... (by ElusiveTau)
prompt the user input and output filename
 
Hello there, I need to prompt the user for the name of an input file and the name of an output file. •I Make sure to verify that the input file exists, •...
[3 replies] Last: thanks everyone I got it (by Leonardo797)
Case-insensitive palindrome checker (help!!)
 
Hello all, I am currently being driven insane by a COSC class that seems to have a large disparity between programming assignments. Prior to this assignment ou...
[9 replies] Last: If all you want is to make the Palindrome check case-insensitive, then... (by seeplus)
by bld
Is code compilation demanding?
 
I'd like to know how demanding is it to compile a simple command prompt based C++ program using gcc or g++. What is the absolute worst machine, that could do...
[6 replies] Last: more than. I compiled on a 286 that was like a 10 HZ chip with no flo... (by jonnin)
Problem with function template
 
Hi, I am getting these errors: error: variable or field 'reversal' declared void error: 'aType' was not declared in this scope my code is to take any ty...
[2 replies] Last: Thanks! that worked. (by jessemicah98)
by DunDun
Help with formatting to a max width or wrapping text
 
Hey guys, I'm trying to figure out how to format my output with a max width so everything is lined up nicely. I am printing various strings x amount of times de...
[5 replies] Last: #include <iostream> #include <vector> #include <string> #include <alg... (by lastchance)
Free function in C
 
Hello, Could you please explain this? I am confused. The first sentence told us we don't need free() memory but in the second sentence told us free() memory...
[2 replies] Last: second that, the first sentence is flat out WRONG. While large compu... (by jonnin)
by felloz
Standard recommendation
 
Hello what is the standard recommendatin to write code in c++? I found this link but idk if is the official? http://isocpp.github.io/CppCoreGuidelines/Cpp...
[3 replies] Last: the link you posted is a solid 'style guideline' and general 'do it th... (by jonnin)
how to write c++ code to work with excel
 
Hi guys, i saw a piece of code in excel written in V.B or V.B.A i'm not sure to apply operation like coping text from excel to Autocad with respective of a spe...
[4 replies] Last: thank you guys "AbstractionAnon", "Thomas1965" , "jonnin" for replying... (by semsemdiver)
When a std::vector is automatically resized, by how much does the capacity increase?
 
When I step-debug through the code and look at Container.capacity() after every call to emplace(), the capacity sometimes increase by 0 (after inserting 4'th it...
[9 replies] Last: .reserve() does not .shrink() also, question your necessity for shrink... (by ne555)
Simple loops complexity analysis
 
for (int i = k; i < n; i = i + m) { statement1; statement2; } From the above loop, there are three facts taken! I have understood the first one. But Can't unde...
[9 replies] Last: I have got it guys! @Andy @Mikeboy@seeplus Thanks a lot (by lost110)
Constructors, and assigning objects to other objects
 
Hi, I am practicing creating classes, and everything that goes with it, as well as assigning objects to other objects. I wanted to try and assign one object of ...
[5 replies] Last: This is completely unrelated to your question, but you could shorten g... (by dhayden)
by jelani
Why won't my boolean work?
 
I am writing a code for a banking system. The menu options include depositing and withdrawing money. I have a bool set up : bool accountExist(false); and ...
[2 replies] Last: Thanks, it works smoothly now :) (by jelani)
network camera access
 
I am trying to access a network camera, the address is definitely correct. I have tried to modify the address string several times by adding and removing infor...
[no replies]
opencv
 
I am trying to display a picture saved on my desktop, but after running this code, I am getting the following answer on my linux terminal: "Image not found o...
[3 replies] Last: nevermind, I made it work. All is needed is to add cv:: to all the lin... (by denbja9)
4 mini programs input and output
 
againtry got it down
[4 replies] Last: [quote=againtry]Just so we don't have another @OP deletion from this o... (by dhayden)
C++ Calculator with multiple input.
 
I tried to make my first C++ Calculator with Multiple inputs not just num1 and num2, but for example; "10 - 8 results to -18" I tried changing the 'result = 0;'...
[3 replies] Last: its almost there so a tweak seems appropriate. if you don't like the ... (by jonnin)
by alix
Remove item from C-array and shift (1,2)
 
I am a beginner, and I want to delete an item from an array, non-STL. This doesn't seem possible? Below. So, out of share curiosity, how can I delete or rem...
[25 replies] Last: I agree that using new to allocate memory in main() is poor. That was ... (by seeplus)
October 2020 Pages: 1... 10111213
  Archived months: [sep2020] [nov2020]

This is an archived page. To post a new message, go to the current page.