Beginners - March 2022 (Page 7)

open .txt, read line by line, store into a string variable
 
I am attempting to take a .txt file, and read each line in to a string. the file consists of a character, followed by a space, and then a name. the character de...
[4 replies] Last: You should have added the code and assignment info as a new posting to... (by deleted account xyzzy)
by chipp
pow()
 
i have a function that do a calculations and also use pow() , BUT, it's really strange that when, for example, i write: (int) pow (10.00, 5); the resul...
[17 replies] Last: Apropos of nothing regarding how pow() overloads work, it is interes... (by deleted account xyzzy)
by Squabs
Guessing within 10 tries
 
So Ive been trying to write a program that guesses a number 100-999 within 10 tries. I cant figure out how to write the tries remaining along with if the number...
[3 replies] Last: #include <iostream> #include <random> constexpr unsigned MaxGuesses... (by seeplus)
Linked List actions
 
I am stuck on a small portion of this stupid assignment. I dont need exact answers, just guidance. The file that I need to open has multiple lines consisting o...
[3 replies] Last: Well without more info, as a starter then possibly something like: ... (by seeplus)
nevermind
 
Could you post an example lib_input.txt so that we know what "blanks and prompts" looks like. You have many lines of hardcoded stuff. You should not: the pro...
[1 reply] : The lib_input file consists of “pairs” of lines, a line of straig... (by keskiverto)
functinos
 
//lets say we have these functions: void RoadReadData() {} void newRoad() {} // what the differnce between these two cases: 1- void new...
[4 replies] Last: IMO it reads like a cut-down interview question... (by seeplus)
Valid Invalid statements
 
Given Question: Output "Valid" if input doesn't start with a letter. Otherwise, output "Invalid". My Issue: Can only ouput "invalid" statements for words t...
[10 replies] Last: > For example, > int i = 123456; > would be "potential undefined beh... (by JLBorges)
I'm getting one error in my code
 
In the ReadStudents function for "Student Student { _id, c, _fname, _lname, _cname, _Icount };" I'm getting an error for the curly brackets. #include <i...
[14 replies] Last: There are various other issues with the code. Consider this, but not t... (by seeplus)
How can I make a "return one directory" function?
 
Let us say I want to represent the current working directory as a std::string and I need to return one directory back. What is the most efficient way of imple...
[4 replies] Last: Thank you a million, George P, that's exactly what I needed. (by bergjensen33)
[sovled]QT - QWidget: Must construct a QApplication before a QWidget
 
In trying to make a QLabel a static member of a class I am getting the message: QWidget: Must construct a QApplication before a QWidget after which the prog...
[4 replies] Last: [quote=DizzyDon]And add this to the MainWindowII constructor: titleLa... (by kigar64551)
[solved] Error multiple definition of static member of class
 
I would like to have a class member pointer static so that I can access it via classname::pointer. In the following code titleLabel is a pointer to a QLabel t...
[2 replies] Last: Doing that removes the multiple def error (thank you) (by LeslieS)
March 2022 Pages: 1... 567
  Archived months: [feb2022] [apr2022]

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