Beginners - March 2020 (Page 5)

by kainev
Variadic Template Recursion - Initialising
 
I've started learning generics, and am trying to create a templated function that will instantiate each given class. #include <iostream> class ClassA { publ...
[3 replies] Last: That code doesn't compile Right, sorry. See the edited post above ... (by mbozzi)
Accessing .txt files with inFile
 
Hello! I am fairly new to coding in general and even newer to C++. I need to write a code that accesses a .txt file, which just has a bunch of type double numbe...
[7 replies] Last: Hello JoeyB190, When working on your program I noticed: ifstream inF... (by Handy Andy)
Creating an object with all properties set at random in c++
 
I have class called Person: class Person{ private: string name; string lastName; int age; static int id; public: Person(); ...
[2 replies] Last: As Jonnin says, what's acceptable? I see age is an int, so is any ran... (by Repeater)
CONverting kilograms
 
Hi, I am a beginner, I have an assignment to convert kilograms to pounds and kilometers to miles. I have created a code that works, however I don;t think it is...
[8 replies] Last: Hello JoeyB1901, The most recent post that is worth reading. "Using n... (by Handy Andy)
How can i use decimal number for "base" "height"?
 
when i tried to use decimal numbers the program skip the next step and go directly to the result #include <stdio.h> #include <iostream> #include <stdlib.h> #in...
[1 reply] : You're writing in C. If it's meant to be C++, then just do it in C++ ... (by Repeater)
by joe809
No Matching Function for Call to...
 
Hello guys! I been having some trouble with these codes. I need to make a cpp file that takes a .h file and do the rest from there. I'm using Vocareum but the p...
[8 replies] Last: I got it working. Thanks for the help guys! (by joe809)
read from file algorithm
 
I have this code to read numbers from a file and put them into an array. but i have a problem which i cannot solve. can you help me please // fileToArray ...
[10 replies] Last: I will study on it No, please, don’t :-( My addition is simply a b... (by Enoizat)
Char Arrays
 
So for my assignment, I was told to create two arrays in which can output this: 0 1 2 3 4 0 X X X X X 1 X X X X X 2 X X X X X 3 X X X X X 4 X X X X X 5...
[3 replies] Last: Hello moswager703, jonnin has offered 3 ways to deal with printing... (by Handy Andy)
code says error, expected ';'
 
I was working on this code and it worked fine in the university lab but when I rewrote the code at home it keeps giving this error expected ';' before 'fr' ...
[5 replies] Last: Hello darshaaa, Sorry I did not see this in your code. It became more... (by Handy Andy)
An algorithm that reads a sequence of positive numbers until a number divisible by 3 is reached
 
Hey guys, I just enrolled in a C++ class mid-semester and know absolutely nothing. My teacher said I can catch up with the others in my class, but it requires e...
[4 replies] Last: What are "couple numbers"? Even numbers? If a number is divisible by ... (by keskiverto)
squares around the rectangles
 
hey guys so the question is : (imagine all this in a big page full of 1*1 squares ) it give 4 numbers in input w1 h1 , w2 h2 and im supposed to pu...
[7 replies] Last: Rectangle 2 is always directly above rectangle 1 and their left edges ... (by keskiverto)
Explanation
 
hey guys can someone read this post : www.cplusplus.com/forum/beginner/268934/ and tell me how he came up with this code ? #include <iostream> #include ...
[1 reply] : Please, keep the discussion in one thread. Douple-posting is not produ... (by keskiverto)
Expanding array size
 
So for one small part of a project, I need to increase the size of an array by 5 spaces. When the code runs and the user enters whatever size and values they wa...
[2 replies] Last: As jlb said variable length arrays are illegal in C++. Use std::vect... (by George P)
Adding ints together from an input file
 
I have a code which looks like this #include <iostream> #include <fstream> #include <sstream> #include <vector> struct Bill{ std::string name; int bi...
[2 replies] Last: Hello INeedSumCode, I have found this to be helpful. http://www.cplus... (by Handy Andy)
Array outputs wrong variable
 
I'm currently learning about arrays, and tried experimenting with it in the compiler- and when I run it, it outputs the wrong variable (it's supposed to output ...
[3 replies] Last: Hello raisetheroof00, Do not remove the post. Others can learn from i... (by Handy Andy)
by Dee5
Algorithm (1,2,3,4)
 
Hello guys I'm working on a project about a vending machine which sells water at a price of 50. The vending machine will not sell water if it doesn't have enoug...
[60 replies] Last: Guys at least help me translate this to c++ please I'm new at c++ pa... (by Dee5)
by LuffyD
How to check for file opened
 
Hello, so i need to check, if certain file exists, first i check if the file has no dot, then if the extension is .txt or .dat, and then i need to check if the ...
[3 replies] Last: Your fucked up spacing makes it a little hard to read, but I think you... (by dutch)
solved
 
solved
[1 reply] : It was a valiant effort, but still came up short. https://www.cplusplu... (by salem c)
Strange run order with system call
 
I was just playing around with exceptions the other day, when I came upon a very strange occurrence. I ran this program: #include <iostream> void fn() { t...
[2 replies] Last: Hello highwayman, Looking at the code differently: include <iostrea... (by Handy Andy)
help with flow control using files
 
For my lab, the user is supposed to input a filename. That file prints out the date and price and then my code is supposed to find the highest and lowest prices...
[4 replies] Last: Hello maddimarrone, Forgot to mention: PLEASE ALWAYS USE CODE TAGS ... (by Handy Andy)
March 2020 Pages: 1... 34567... 14
  Archived months: [feb2020] [apr2020]

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