Beginners - April 2019 (Page 10)

by DadamE
ISBN-10 "calculator"
 
Hello; I am new to programming, and in need of some assistance with a problem in trying to use a string... My error seems to be happening where the calculation ...
[3 replies] Last: so check to see if you just meant = instead of ==. This and the rever... (by jonnin)
Snake game problems
 
I am trying to write my own snake game(I am learning from http://www.cplusplus.com/articles/3U75fSEw/), but i encountered problems that I canĀ“t just solve. For...
[2 replies] Last: the classic snake game moves like this: draw a new pixel (box, *, what... (by jonnin)
Minimize daily route
 
Hello everybody, I need help at an program-task I want to solve. It's more a logical question than a programming question. The problem is: A hiker wants to...
[2 replies] Last: some cases require checking every permutation. the best non full chec... (by jonnin)
classes, with functions
 
So, I need to know how to display the function, i made a function createCars, now I'm trying to make a function viewCars, and I'm not quite sure how to call a f...
[12 replies] Last: The pain of having to rewrite code over and over again as it gets expa... (by deleted account xyzzy)
Why Make a Namespace
 
what is this for. why make a namespace. this doesn't do anything, I was just messing around with namespaces #include "pch.h" #include <iostream> #include <v...
[5 replies] Last: That sounds useful It is, very useful. using namespace std; trash... (by deleted account xyzzy)
D&D player and Int help (1,2)
 
Hi Im new to C++. To help me learn I made a program that shows me my charters states and iteams and what not. Took me a long time but I feel like I got loops ...
[20 replies] Last: Thanks MikeStgt that helped alot acctuly (by Harry792)
How to access derived member functions from base class.
 
I want to access some member function in a project I am working on. These member function are in a derived class that get me private data from that object clas...
[4 replies] Last: If you want to call SetX() or GetX() on all values in vector v then yo... (by dhayden)
by molia
Operator overloading
 
The compiler shows error while overloading << and >> operator, can someone help me removing the error please...thanks. #include "Matrix.h" #include <ios...
[1 reply] : in>>k(i,j) >>" " ; You can't extract into a string literal. Just re... (by dhayden)
Adding and displaying information
 
Hello guys, I'm trying to add customer details in one function and display the added details in another function. I used a for loop to do this therefore I have ...
[1 reply] : Hello snoozycs1, PLEASE ALWAYS USE CODE TAGS (the <> formatting but... (by Handy Andy)
by ksolo7
Having trouble pulling boundary data points from input file
 
I have an input file that consists of data in the form "Celsius,Resistance", for example one point is "5,12700" which stands for a temperature of 5 degrees Cels...
[6 replies] Last: @ksolo7, If you are going to interpolate then you should be reading va... (by lastchance)
by TJW
Use the pointer to a structure array
 
I just started learning pointer. I wanted to call the selection sort function to sort a structure array by the test scores, but the function call had an error: ...
[5 replies] Last: To Peter87 Thank you! I just added "cin.ignore()", and it worked. The ... (by TJW)
Height in feet and inches converted to meters.
 
I've got a problem with this program. For some reason, it's not doing the calculations and it's not asking if the user would like run the program again. It s...
[5 replies] Last: Excellent questions. What is the point of the "f" after "12.0 12.0 ... (by deleted account xyzzy)
Multiple definition error
 
I have this work, and finally finished it with only a header. I have to have .cpp and .h files. However when I try to split my header, I get the following error...
[2 replies] Last: Repeater thanks for reply. I forgot to comment out int root = 0; lin... (by yucecoder)
Operator Overloading of >> in Classes causing issue
 
I am trying to make a class for Polynomial which will take input of the max degree of the polynomial and then accordingly, will set the maximum array size and w...
[3 replies] Last: Ah, my bad. Guess the issue was just the other stuff you mentioned. (by Ganado)
by fer021
I can't run my program
 
Hello I need some help with c++. I wrote a program and don't know what happen but when I opened the .cpp all my code disappeared. I'm sure that saved archive be...
[1 reply] : you have opened something else. compilers generate other files. look... (by jonnin)
Trying to understand this Code
 
I have been learning on my own. Can't really understand voids. The only thing I picked up from online really is that they don't return any vaule witch is kinda ...
[1 reply] : void toUpper(std::string str) Makes a copy of the passed string, any... (by deleted account xyzzy)
#define?
 
I am having trouble understanding what #define does. I see it used a lot so I assume it is very useful but I cant wrap my head around what it does.
[3 replies] Last: you can also use them to force inline code (one reason to use a macr... (by jonnin)
by sk1234
Please Help DFS code explaination
 
I want to solve this question as i am new to trees and i could not able to understand the editorial. https://www.codechef.com/APRIL19B/problems/SUBREM int d...
[3 replies] Last: Here's a description of dfs(). I can't say for sure that it solves the... (by dhayden)
Help for the highest
 
I'm trying to calculate the highest number and it is not letting me and it is giving me an error. r: invalid types 'std::__cxx11::string {aka std::__cxx11::ba...
[5 replies] Last: You need to return the index number of the highest selling salsa to us... (by deleted account xyzzy)
Trouble reading csv file into vector of struct
 
So I have a csv file with stock information and I'm trying to read the file into a vector of a struct I have created with members representing the different dat...
[8 replies] Last: Hello AshtoKream, The order of the arguments makes no difference. Wha... (by Handy Andy)
April 2019 Pages: 1... 89101112... 24
  Archived months: [mar2019] [may2019]

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