Beginners - September 2021 (Page 7)

Placing Functions inside class vs outside
 
I see that a function can be coded directly in side a class--or--a model/header can be defined inside the class an the body of the function defined outside the ...
[6 replies] Last: OK and thank you for all the deliberation. As expected there are "fine... (by fsonnichsen)
looping function
 
Hi everyone. I'm writing a code which takes 4 files and do statistics stuff with the datas. I really would like to avoid this ugly copy-pasting, but I don't kno...
[4 replies] Last: Ok, so you can have a struct which represents the data, but you won't ... (by TheIdeasMan)
Functions
 
Hi everyone, I'm fairly new to c++ and I'm working on an assignment that I have managed to work through most of it, however I do have some issues. 1. my func...
[10 replies] Last: For the others, consider: #include <algorithm> #include <iterator> ... (by seeplus)
by ppkaa
Access Violation Writing Array Reading .txt
 
Dear all, I'm a newbie in any programming, and recently must work on c++. I have a difficulty in forming an array and reading a file at the same time. I have...
[3 replies] Last: Dear Jonnin and TheIdeasMan, Thank you for the advise. I will reproce... (by ppkaa)
If/Else coupon problem
 
I've been having a difficult time completing this code and getting it to run properly. I'm a beginner with if/else functions (obviously). Any help or advice is ...
[1 reply] : In function 'int main()': 78:2: error: expected '}' before 'else' 33:... (by TheIdeasMan)
Arrays
 
Now both of these codes are logically correct and should give the same answers and in arrays if I did not put the index but I assigned values to the array I do ...
[3 replies] Last: In your second loop, during the process you are trying to display the ... (by Geckoo)
Homework fill in blank question to figure out output
 
Suppose that you have the following C++ Code segment. Show the contents of each variable and the contents of the Input Buffer after each C++ statement executes....
[3 replies] Last: 4) cin of an int is weird. its going to read the whole thing and cons... (by jonnin)
Vector version of pointer pointer array
 
Are these roughly equivalent? Not sure if the *'s are in the right place for the vector int **myArr; std::vector<int*> *myVec;
[3 replies] Last: I generally prefer to keep everything 1d as much as possible for a var... (by jonnin)
by LeoV3
How does program know array size? (1,2)
 
Hello, I'm learning to code in C++ by reading "Programming principles and Practice using c++ (2nd edition)" by Bjarne Stroustrup. However, decided to clear some...
[24 replies] Last: I really do like using std::array over using a plain array more than ... (by seeplus)
Loops to make 3 tables of Celsius, Fahrenheit and Kelvin
 
Ive gotten started on this hw homework problem due tonight but I am completely stumped. Prompt: Write a program that creates three tables of temperatures in C...
[7 replies] Last: @againtry Nevermind I got it to work, thanks for the help! (by gigacapybara)
Convert 12 hours to 24 hours
 
I am stuck on a homework problem where I have to convert 12 hours to 24 hours. Prompt This programs lets you practice using the String Processing Operations. ...
[8 replies] Last: #include <iostream> #include <string> #include <iomanip> /* 5:30:00... (by againtry)
binary search tree confusion
 
Hello, I am learning data structures from youtube - mycodeschool, and most is really easy to follow apart from this binary search tree. The code from the video ...
[5 replies] Last: yea this looks like older code, C++ converted over from C. Maybe on p... (by jonnin)
how can i prent the array after evry pass in bubble sort
 
My sort works. unfortunately I don't seem to be able to print the array after evry passes, do I need to pass to another function? #include<iostream> us...
[8 replies] Last: Or even as C++20: #include <algorithm> #include <iostream> #include... (by seeplus)
by alexas
rotation of the cuboid chain (1,2)
 
I asked this question long time before with no success but it was even more complicated situation. I managed to simplify it and the question is now like that: ...
[37 replies] Last: Just simple Thanks just does not sound seriously, I was totally lost i... (by alexas)
Why does my code on C++ skip the getline on line 30?
 
Why does my code on C++ skip the getline on line 30? #include <iostream> //For the common codes #include <string> //For the string function/container #i...
[3 replies] Last: Hello Silver29, If you are still interested and catch this. Some sugg... (by Handy Andy)
by derpus
How do I check what specific char has been outputted to a specific xy position in the console?
 
How do I check what specific char has been outputted to a specific xy position in the console? I am working on a rouge-like demo game to test my knowledge an...
[9 replies] Last: The Windows console is based upon a resizeable 2-d buffer and a window... (by seeplus)
How to count uppercase and lowercase strings
 
I managed to finish this homework problem, the only issue is that it did not count instances of a substring in a string properly to include uppercase T's PROMP...
[5 replies] Last: For some versions of some compilers (gcc?? - VS was OK), you had to wr... (by seeplus)
by AkiraC
How to print out sum for every loop?
 
Hi, I wanted to sum up the marks of one student, then proceed to the next student, however, the sum of the second student includes the sum of the first student....
[6 replies] Last: Hello AkiraC, I finally figured out the problem I was having. In the... (by Handy Andy)
September 2021 Pages: 1... 567
  Archived months: [aug2021] [oct2021]

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