Beginners - July 2020

Reading the first character of a line from a text file
 
I have a text file like this: 0 user1 1 user2 2 user3 3 user4 4 user5 If the first line of the str...
[2 replies] Last: Yes that works, thank you. (by CodePanther)
Curious?
 
I set up a variable such that... float P; Then I assigned a value to it... P = 2 / 7; ...
[3 replies] Last: Thank you; hadn't realised the integer division thing (lovely how all ... (by Gazzieh)
Working with vectors
 
I am new to C++ but not programming. I am currently working from an old FORTRAN piece of code, wh...
[5 replies] Last: Thank you lastchance; I will do so immediately. That will make my code... (by Gazzieh)
Point.h
 
Good Evening, I created a Point class defined within two files, Point.h and Point.cpp.(following stu...
[14 replies] Last: g++ -Wall PointTest.cpp Point.cpp -o program Assuming PointTest.cpp ... (by Ganado)
no matching function for call to "" (1,2)
 
This is my specification file, and my implementation file isnt working. #ifndef DATE_H #defin...
[25 replies] Last: Something to think about in relation to the use of arrays I mentioned ... (by againtry)
dereferencing pointer
 
Hey y'all, hope I write this question correctly. My question is directed at the line quiz ->display...
[2 replies] Last: Ah that actually makes perfect sense, thanks for the input. (by noblemin)
Arrays from text file?
 
Here is example input.txt: 100 100 100 100 90 100 100 100 80 100 100 100 100 10...
[5 replies] Last: First column is score and second column is total possible per assignm... (by dhayden)
by AL88
Why is this infinite while loop with the printf not looping for ever?
 
Why is this ifinite while loop not repeating the printf statement? It only runs it once! please help...
[3 replies] Last: Great minds think alike. (by againtry)
Getting input from a string?
 
Hello, I am working on a problem where I need to get user input for a string. I have below posted an...
[5 replies] Last: https://docs.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp?view=vs... (by againtry)
Another array question
 
Could I have some help with an array. I believe that I need a two-dimensional array. Here is exactl...
[5 replies] Last: Thank you for your help, it worked out. (by Fayezilla)
help with istream and get()
 
Hello, i am using the get() function to extract data from a single line of text into multiple fields...
[1 reply] : Is there a particular reason that you're using C-strings instead of C+... (by jlb)
Why am I receiving these errors about multiple definitions?
 
Hi, I am receiving the following errors regarding a virtual class with derived classes from it r...
[12 replies] Last: Hi MikeyBoy Some time ago I had coded a program to calculate the expo... (by Shishykish)
Roll dice function rand() always gives same result
 
Real noob here. Started learning C++ as of this week. Trying to create a dice rolling program where ...
[1 reply] : Your rollDice function seeds the random number generator with the curr... (by Repeater)
Passing array to function
 
Say there's an array: int arr What data types are passed to a function f by f(arr, &arr)? Pleas...
[7 replies] Last: Thanks all for your explanations. (by Simon90)
Vectors
 
Hey pals, i've finished learning the loops( for, while, do while), switch, if, if-else-if , &&, || ,...
[10 replies] Last: I used to merge againtry's and ne555's code and it seems legit. So muc... (by MaxGreen)
Can someone help me with this assignment please, I cant figure out why my loop is exiting early (1,2)
 
This is only my second quarter doing C++. The assignment is to steer the rat into one of three holes...
[20 replies] Last: This is actually easy code. If you are up for the challenge and you ke... (by johnglen244)
Infinite loop when validating input
 
In my program, I am trying to validate the users input an make sure that the only thing they can put...
[2 replies] Last: I use it for when cin fails due to somebody inputting characters or if... (by greenway)
by F95
Incorrect count output / Having difficulty trying to create a HashTable/Set using open addressing
 
I'm trying to create a program that opens a .txt file containing a speech and assigns each word to a...
[11 replies] Last: also you are missing mTable .state = Entry::FULL; in your add() func... (by ne555)
Sqrt root
 
Write a program to calculate the following equation for any value of x (user input value): sqrt (...
[8 replies] Last: #include <iostream> #include <cmath> using namespace std; int main(... (by againtry)
Writing to the Console Buffer
 
Hi, My C++ skills are improving but I want to write a fair bit of general code before branching int...
[9 replies] Last: Many thanks. I'll give this a run and go through it. Why don't you... (by Thunderchook)
July 2020 Pages: 123... 12
  Archived months: [jun2020]

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