Beginners - February 2019 (Page 3)

Code Output Not What I Expected
 
This is a homework problem, and I know we aren't supposed to post about these kind of questions, but I have all the code written out except for I am not getting...
[2 replies] Last: Instead of using file.write? Edit: I figured it out. Thanks for the h... (by WolfgangBeier)
I'm at a loss (input/output)
 
I have an assignment that requires me to read names from one .txt file and grades from another and send the average(in letter grade) to an output .txt file. I'm...
[9 replies] Last: Well, you could do it like this: #include <iostream> #include <fstr... (by Cheddar99)
using a recursive function with a linked list
 
i need help creating the print() function. It is supposed to print all elements of the list from first to last. since i had to create this program in separate f...
[2 replies] Last: whoops i totally forgot to include main of course. the program seems t... (by Kukamunga)
by vysero
troubleshooting segmentation fault and the ~ in a method decleration
 
There is a bug in this application that causes the app to crash. I can replicate the bug and so I loaded up gdb (first time user) through Eclipse and replicated...
[4 replies] Last: > (gdb) print m_glTess > $2 = (GLUtesselator *) 0x1 Nobody likes to... (by salem c)
by Majeek
std::cin not resetting in loop
 
Whenever I enter an incorrect answer (main()) then it keeps looping and having this output without stopping to std::cin. Usually std::getline would fix this bu...
[3 replies] Last: My full code is here (I finished thanks to your code) #include <iost... (by Majeek)
Need help finding a way to add a third function to my program
 
Note that you don't use finalSalary anywhere and you don't actually need array for raise. What if your main would look like: int main () { constexpr int N =...
[no replies]
Movement for game
 
I want to make a game for my sem project and I need WASD movement for that. I was planning to make it using getch(),switch() and gotoxy() but how do I get the c...
[1 reply] : Maybe wherex() and wherey(). https://www.programmingsimplified.com/c/c... (by dutch)
by Majeek
Array And Return Help
 
#include <map> #include<string> #include <iostream> std::string Third(); std::string Ask(); std::string Ask2(); std::string WhoIsPicked3(std::string Noth...
[1 reply] : There's no main() to run your program and variables name such as 'No... (by Enoizat)
Program to read input one line at a time.
 
So I am still very new to C++ and I am trying to write a code that reads the standard input one line at a time and then reads one word at a time. This is all th...
[10 replies] Last: Note that using dhayden's example you would need to do so in two loca... (by dhayden)
Using an array to hold characters for a switch Statement
 
Hi there, So i just need a little guidance about if I've gone totally the wrong direction and over-complicated everything, and why my switch statement wont ...
[8 replies] Last: Regarding lower case letters, this is a good example of where it pays ... (by dhayden)
by Bopaki
error: 'root' was not declared in this scope
 
This is first program on binaryTrees. The header file given in the textbook by DS Malik goes like this I get these errors: binarySearchTree.h:49:8: error: 'r...
[4 replies] Last: The interesting question to ask now is: When do we use the this-> ... (by Bopaki)
Scope of Heap Allocated Objects
 
I thought that one of the main benefits of heap-allocation was that the pointer/object has a scope of the entire program, but in the example below, the three he...
[19 replies] Last: Ganado says Yes, but don't do this in modern C++. Just return a... (by calioranged)
by Ste
EXIT_FAILURE and EXIT_SUCCESS not declared
 
hi quick question I’m using c++ but having a bit of trouble. return EXIT_FAILURE and return EXIT_SUCCESS not declared. Does anyone know why I get this error. ...
[2 replies] Last: Thank you i’ll Give it a try thanks again (by Ste)
C++ Classes Inheritance
 
Hello!, having some problem in writing code with multi inheritance: in classA.h class A declaration, same goes to classB.h - classH.h in class B.cpp - ...
[6 replies] Last: "AbstractionAnon" Thank You I'll try this method, but it's not the thi... (by tivrkoker)
by Hajo93
Read txt file, and use the information from the text file
 
I have a text file that looks like this Stop sign 58.327628, 8.546318 58.311932, 8.522903 Speed sign 58.2999645, 8.477316 The numbers are coordinates an...
[4 replies] Last: #include<iostream> #include<fstream> #include<string> using namespac... (by salem c)
Fractions
 
Hi, I am writing a program that lets the user input two fractions and choose which arithmetical operation to use. I am not sure why, but the program does no...
[2 replies] Last: There's a brace or two missing, and you also have assignment operators... (by Cheddar99)
C++ class question
 
How does the mathematical expression (3 ≤ n)∧(n ≤ 7) translate to C++?
[2 replies] Last: I have to ask: What is the ∧ ? Wiki says "logical and". If so, the... (by keskiverto)
Infile Multiple Parts on a Line
 
Infiles have been a struggle, so multiple pieces of information on one line is proving difficult. For this I need to read in a customer's code, quantity, and pr...
[2 replies] Last: I'm blind. Thanks so much! (by ZestyCthulhu)
OOP help with comparing 2D arrays with a class
 
Hello out there! I have an assignment that wants me to create two squares with the dimensions of the user input. Once I have the length and width inputs from...
[1 reply] : https://en.cppreference.com/w/cpp/language/operators Scroll down to Re... (by salem c)
client defined enums
 
Hi I'm writing a library, which will allow clients/users to interact with an object E. E has different properties but one of the member variables stores an e...
[1 reply] : it depends :) now, if you had some magic class called "properties" a... (by jonnin)
February 2019 Pages: 12345... 23
  Archived months: [jan2019] [mar2019]

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