Beginners - January 2018 (Page 10)

Writing a method for a templated private member
 
I am trying to understand the coding by inserting std::cout's to print messages at the console. After inserting the following coding: std::vector<int> v{ 1...
[12 replies] Last: Thank you, JL. As for the #if 0 , it appears the author wanted to ... (by phztfte1)
Pythagorean theorem help
 
#include <iostream> #include <cmath> using namespace std; double a, b, c, width, height; int main() { cout << "Enter the width value of the display ratio: "; ...
[1 reply] : To give you an idea about how to do the Pythagorean theorem. #includ... (by chicofeo)
Ratio not working
 
#include <iostream> #include <cmath> using namespace std; double ratio, display, width, a, b; int main() { cout << "Enter the width value of the display...
[2 replies] Last: Just to give you an idea about the to the Pythagorean theorem. #incl... (by chicofeo)
How to deallocate memory from an instace of class
 
Hello. First, sorry for my bad English. I've read several times that it is possible to "delete" an instance of a class using delete expression(or it is automati...
[5 replies] Last: delete is dumb, it will take a crack at any pointer, no matter how you... (by jonnin)
by ZhuZhu
Random generating a array of enum with no repeat elements
 
I am trying to generate a array of enum with no same elements, but what I have done still gives me repeat elements. What is wrong with my codes? P.S I haven...
[3 replies] Last: You seem to missing a few basics, pointers and arrays. https://compute... (by kbw)
segnementation fault
 
Hello im getting a segnementation fault and i dont know how to fix it ,i think it happens when i use new and i try to create a pointer to a class that i use in ...
[4 replies] Last: No idea why it didn't work. Try it again with vectors, clean it up, a... (by jonnin)
Classes Help
 
I created this program but when I output it it outputs random numbers #include <iostream> using namespace std; class Book { private: int ...
[1 reply] : When you are assigning variables it is the value on the LHS of the = w... (by lastchance)
by Mapler
Concurrent player actions in a c++ game
 
I'm quite a beginner in C++ asking for advice from other C++ people! As a way to practice coding, I have been working on a simple c++ game that involves a playe...
[1 reply] : Is the main question here how to decouple updates and draws? If you d... (by jonnin)
"Abort trap: 6" Error when writing simple sort code
 
I am trying to refresh my knowledge of C++ basics. I found a prompt online to create a simple program that asks the user to input the number of pancakes eaten b...
[2 replies] Last: Thanks! That was definitely something I forgot about when writing the ... (by aMerkel)
String digit occurence
 
Hey guys. What is the best way of approaching creating a program that looks at a string of characters and digits and prints the most frequently occurring digit....
[14 replies] Last: In the spirit of keeping it simple ... to find the maximum frequency o... (by lastchance)
how to calculate a body
 
i dont know what is worong and how to input header files in my programm. i am using codeblocks thanks for helping. void read (body * const f) { ...
[3 replies] Last: heh I would argue that c:/folder/file probably won't work on unix no ... (by jonnin)
program checks user's math answer, WON'T WORK! PLEASE HELP!
 
Hi there! my code is supposed to ask the user what math operation they want to do, ask their answer, an d check if it is correct. It gives 10 points for the fir...
[2 replies] Last: Well just to start something rolling, two obvious issues I see is that... (by Ganado)
I have a question
 
Our professor gave us an example and we have to found the misstakes in this program. I can not find any misstakes. Is somebody able to help me? #in...
[6 replies] Last: in your for loop there is missing a (+) (by cupdater)
Unsigned int in while loop
 
Hello Currently I'm reading a book on c++ algorithms and I stumbled upon the Fibonacci numbers and how to iterate through them but I don't get 1 thing and that...
[3 replies] Last: Okay thank you! That clarifies alot :) (by stonedviper)
Help please not compilable
 
my program is not Compilable this program takes the numbers and has to put sorted numbers out #include <stdio.h> int main(void) { float v...
[4 replies] Last: thank you thomas there was missing ; instead of , (by cupdater)
Multiple Bouncing Balls Program in C (Please Help) (1,2)
 
I am trying to make a program in C with multiple bouncing balls. I know it is a very known program and I have already searched the internet and seen different v...
[25 replies] Last: Alright. Now I understood. It shows me this: https://mega.nz/#!NRwEAJ... (by Derekmak)
by Zalkin
Need help with read from and write to a .txt file.
 
Hey i'm new to programming. I am coding in c++ and have to make a program that reads names and their age, add the sum of all ages then display it. Which works. ...
[5 replies] Last: #include <iostream> #include <fstream> #include <string> using namesp... (by lastchance)
by sambix
How to read a txt file into an array of structures?
 
I can't get my array to read my file properly. When I run the program, it doesn't read my file properly....what am I doing wrong? #include "stdafx.h" #inc...
[3 replies] Last: Please tell me what is the output? (by teerguru)
Dumb'n'Noobie question: Switch into While
 
Hello, World! (no offence!) I'm studying C++11 from the Stroustrup but I have already study the C, then I know the basics of this type of programming languages...
[2 replies] Last: That's Right. Thank you :) (by obshumi)
A problem with Function Template Specialization
 
I'm trying to do a specialization to a const function template, but i obtain this: C:\proyectos3\Capitulo 8\EX6\main.cpp|11|error: template-id 'maxn<>' for 'co...
[2 replies] Last: Thank you very much JLBorges for your repply, you have helped a lot :D (by candidatopardo)
January 2018 Pages: 1... 89101112... 22
  Archived months: [dec2017] [feb2018]

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