Beginners - December 2020 (Page 5)

by kmce
auto in templates?
 
I am going through tutorials on c++14 and it is introducing the keyword auto. It says it can be used in templates, but what is the point in this? I though in te...
[4 replies] Last: But is it basically auto is being used to determine the return type. ... (by mbozzi)
by kmlz
reading as numbers and saving as colors
 
Hi, i need to develop a program that writes a color to the screen and each line of another file according to the numbers read from a file. (The file name to be...
[11 replies] Last: That is telling you that you tried to build the program with outdated ... (by jonnin)
Arrays & rounding from float to int
 
I need help getting started here. I am having a wicked brain block. I don't know if the wording is confusing me or what. This is my first experience with arrays...
[5 replies] Last: so I got this for the last part - technically it works.... thanks for ... (by CTonevski)
Trying to make a program to solve an equation for me
 
This is a very odd post, but I am making a program in order to predict how many games it would take to reach a certain goal in a video game. I am trying to get...
[9 replies] Last: Ah right right, that makes sense my bad. (by TheFlyingGamer)
Rejecting a floating point
 
Hello, I am very new to C++ and in the process of trying to write a programme. Part of the programme will be to work out a factorial amount which I have working...
[4 replies] Last: #include <iostream> #include <string> #include <limits> using names... (by Manga)
get and set char *
 
That's part of my HW as an introduction to "set and get" to classes. We had to write a code which will create a class with different properties data types as...
[4 replies] Last: seeplus thanks for in depth explanation (by MaxGreen)
calculator
 
LOOK AT MY CODE: #include <cstdlib> #include <string> using namespace std; float m = 0, n = 0; float wynik = 0; string mojwybor; int main(int argc, char*...
[5 replies] Last: Hello majkel1234, Working with your original code: #include <cctype... (by Handy Andy)
dynamic cast
 
Hello I am trying to learn about dynamic cast, and i thought I had worked it out then I came across some pieces of code and I am not sure about it again. Hoping...
[11 replies] Last: I think the animalBase to cat works because the base class still know... (by MikeyBoy)
logical calculator
 
hey yall , so i have to make a logical calculator with : (& and , | or , ~ not ,> if) i made this with (+,-,*,/) for logical calculator (with parenthesis)...
[8 replies] Last: delete the classes bring the infix part in main function also u dont n... (by maximus854)
Cannot print 3D array using function
 
I can’t print 3d array by using the following function. Is there something I am misunderstanding? #include <iostream> using namespace std; void pri...
[5 replies] Last: #include <iostream> using namespace std; void printArray(int *, int,... (by lastchance)
simplify the code
 
how to wtite it using a char array? Q: " given a string. obtain another one by swapping the parts of the first one after the first entry of space" *dont mind...
[5 replies] Last: thank you all so much!! :) (by laura fidarova)
convert to an array of symbols
 
Hi, i remember that someone helped me with this code here, thanks a lot for that. How can i write it as a charr array? Q: "in a given string change all the ent...
[2 replies] Last: #include <iostream> int main() { char test = "$$?@@**$@"; int ... (by lastchance)
Separating .txt Lines Into Different Variables
 
I'm trying to find a way to read a .txt file and take each line of it and store it in a variable to manipulate each section later. The text file looks like thi...
[1 reply] : > 3 <- number of sides What's the significance of this number? It it a... (by salem c)
Battleship Game
 
Hello, I'm having trouble with two lines of the code below. Lines 37 and 38 are giving errors Line 37 " 'voidFire(char)': cannot convert argument 1 from 'cha...
[4 replies] Last: You need to move a couple of lines down, so it's outside the outer loo... (by salem c)
How extract the name of a file
 
Hi all, I am beginner on C++ and linux and one of my tasks is extract the name of a file and compare if it is a new version or not. For example, the file nam...
[1 reply] : the <filesystem> header has a lot of very powerful things that older c... (by jonnin)
writing operator
 
the question is:modify the writing operator so it can read information about the route you can use getteri and or friend functions the display will be: depart...
[6 replies] Last: thank you all I rewrite the code as per your advices and now it works (by laura11111)
Need some help.
 
So I have this code that supposes to look clean and organized. I'm having issues with keeping class, cadets, and price in order. Tell me what you guys think. Th...
[4 replies] Last: Consider for C++17: #include <iostream> #include <iomanip> #include... (by seeplus)
How to create a new custom type with given vector
 
Let say I have a vector of ints, and I want to specify an additional value for each of them like a string or bool. I was thinking about something like that but...
[9 replies] Last: Post a complete sample program. There's not sufficient info/code to ad... (by seeplus)
How to cout a message inside a function other than main
 
Hello, I can only print a message, via std::cout, when I'm in main(). However, when I'm inside a function other than main, std::cout does not work. How can...
[1 reply] : Compile and run this code. Does it print the message? #include <ios... (by nuderobmonkey)
Help
 
Bitland has N cities connected by one common highway. East of the first the city has a Bitzon warehouse. Distance from Bitzon warehouse to first city is m1 time...
[2 replies] Last: #include <iostream> using namespace std; int main() { // read t... (by booradley60)
December 2020 Pages: 1... 34567... 11
  Archived months: [nov2020] [jan2021]

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