Beginners - July 2019 (Page 2)

How to organize these code?
 
Hi guys, I am planning use boost or Qt library. Not both in one compilation but both in one repository: C++ files will categorized: 1. Files related to boost...
[8 replies] Last: [quote=Niccolo]Anyone notice that @levithanh425 hasn't participated in... (by Duthomhas)
Word Break
 
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible...
[10 replies] Last: dhayden + 1 Memoization is important in this kind of problem. Afte... (by Duthomhas)
by lll
How I put in a 2D array data from a file?
 
Greetings. I want to put the data from a file of 10 rows with 5 data each row in an 2D array of the same size (30X15) but I don't know how, I would appreciate a...
[8 replies] Last: A “segmentation fault” is the OS’s way of informing you that you... (by Duthomhas)
case switch
 
I'm working on an assignment and I was wondering if you can call functions in case switches? Maybe a dumb questions forgive me. I have a question about overload...
[16 replies] Last: I think you are overthinking this. Yes, post your instructions and we... (by Duthomhas)
{} after initialized variable
 
Write your question here. new to learning and want to understand what is the {} for after billTotal for? without it "billTotal" in the billTotal = billtotal ...
[4 replies] Last: Admittedly, one of C’s (and especially C++’s) weaknesses is the co... (by Duthomhas)
by dkm04
Reading a config file into 2d array
 
I have a external config.txt file containing the following information. [0, 0]-41 [0, 1]-93 [0, 2]-90 [0, 3]-24 [0, 4]-70 [0, 5]-39 [0, 6]-47 [0, ...
[2 replies] Last: @dutch thank you very much, you save my day! I have been trying to sea... (by dkm04)
C++ Embedded systems learning
 
Hello all, Going to try looking at using Modern C++ with embedded systems and wondered if anyone here recommended a(any) good book(s)on the topic or on-line ...
[5 replies] Last: Thank you gentlemen, RJ, I will go to that site and check it out. My... (by Xanadu4ever)
Displaying Unicode characters on Windows, Mac and Linux?
 
If I use setlocale (see below) in the main function, it works alright taking and storing the user input and displaying it again, characters like "ů". The pr...
[5 replies] Last: When I instead use setlocale(LC_ALL, "utf-8") some characters are st... (by jsmithplus)
How to use Scroll Area in Qt to print a QString array
 
Hi everyone, I am trying to understand how to use "Scroll Area" in "Containers" of Qt when designing GUIs. In my case, I have a display function which displa...
[1 reply] : QScrollArea is a "widget", not a "container". I suppose it's kind of a... (by dutch)
String ordering is working, but also not.
 
Hi, I'm working on sorting a string of digits 1 - 5 until it equals 12345, one swap at a time, then printing the string after each swap. The swap I want is su...
[13 replies] Last: ohhhhhhhhh. Thank you. ** edit ** I touched up my code to let it ru... (by jjordan33)
by libi
Splitting words from string into vector
 
Was just trying to do a simple challenge problem and can't figure out why this doesn't work?? Splitting a string into a vector based on ascii value to separate ...
[2 replies] Last: @dutch ohhh yes you are absolutely right. Thank you. (by libi)
How to handle the 'C2678 binary '<' no operator found' error"
 
Hi Everyone, I'm trying to figure out a way to solve the C2678 error in my code. I'm using a map, which stores an object as the key and a vector of objects a...
[2 replies] Last: I found out, that I should either define the operator< or overload i... (by Ganado)
Object Class in C++
 
I need help on how to run code with (#include "Rectangle.h") in Dev-C++ IDE. Every time I try to run the code below with Dev-C++ or online GDB, I keep getting c...
[7 replies] Last: 1) Do you know what directory your Rectangle.h file is currently in? ... (by MikeyBoy)
Using namespace std (1,2)
 
We all know how to use it, but how does one stop using it? using namespace std; int main(){ cout << "blah"; //stop using namespace std; howeve...
[24 replies] Last: I prefer, over namespace, but sometimes std, and definitely typedef. ... (by Shibitto)
by HEAden
Why is the name of the files affecting the structs in C++?
 
Using the below code: //h.cpp #include "main.h" #include "api/core.hpp" extern pros::Motor frontLeft; extern pros::Motor rearLeft; extern pros::Motor f...
[17 replies] Last: Here is the solution: Motor_Group& leftDrive() { static Motor_Gro... (by HEAden)
Trouble with lexicographical sorting in doubly-linked-list
 
I'm currently working my way through Programming, Principles and Practice Using C++. I'm in chapter 17, which is basically an introduction to pointers and memor...
[4 replies] Last: @Niccolo, I think I just made the mistake of not really thinking it th... (by grumblesnake)
Best value in array
 
quick question, how do i get the best score, for example, after inputting 5 scores of 20, 40, 60, 80, 100, it tells me the best score is 100, before calculation...
[12 replies] Last: Isn't working That is not a sufficient description of a problem. In... (by keskiverto)
Actual real FLTK problem now. (1,2,3)
 
After my recent exploits... with getting FLTK (v 1.1.10) installed successfully... I think I've actually run into a real problem now. The book instructs us t...
[43 replies] Last: Niccolo, You are a great help man. A real mentor after the type Stro... (by Xanadu4ever)
C++ Using output file help
 
Okay, so I am asked to output something like this: The 10 random numbers are: 44 61 98 45 45 17 63 24 9 95 The average is 50.10. There are 4 numbers ab...
[14 replies] Last: So it runs now, is this the right way to do this with an array? #in... (by scooter28)
Number Array Class get highest function
 
Hello, I'm attempting to brush up on my C++ and am having issues with this program challenge. Everything was going good, but then I started having issues with m...
[4 replies] Last: Ah! I see what you're saying now. Thanks so much for clarifying that f... (by newbcoding)
July 2019 Pages: 1234... 11
  Archived months: [jun2019] [aug2019]

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