Beginners - March 2020 (Page 3)

"Not declared in scope" error
 
I am fairly new at programming, and I really cannot figure this one out. When compiled, I get 'Expected primary expression'errors for the array in main, and 'N...
[3 replies] Last: Hello starlightexplorer, Since this is for an assignment post the act... (by Handy Andy)
Function Returning
 
I need to create a function that asks for the user input (1-6) to make a choice. The numbers are linked to a movie so I used a switch to do that but when I go b...
[4 replies] Last: Got it! thanks (by fish692)
Help with validating user input
 
I am doing a problem from my book I think I have everything else right except I can't seem to figure out how the validate choices. Help would be greatly appre...
[2 replies] Last: Hello mollywhoppinRBG, There are several ways to validate what you ne... (by Handy Andy)
how to use time.h
 
Hello guys,how i can use ccc_time.h? when compiling it gets me an error : ccc_time.h: No such file or directory
[10 replies] Last: Hello popcornaaa, The problem with ("ccc_time.h") has already been co... (by Handy Andy)
by alexas
rotation matrix does not work
 
Hello, I am playing with the code to learn the rotation matrix, trying to rotate a single point in the vector, yet without correct results, and cannot understan...
[4 replies] Last: Just learning in a hard way... thank you very much, I still don't hav... (by alexas)
unresolved externals
 
from what ive seen this shouldnt cause an unresolved external - but i cant get it not to xD any help appreciated, ty //bhop.h class c_bhop { public: void r...
[3 replies] Last: i fixed it - turns out when it says 'included in project' doesnt mean ... (by privileged)
Giving error at accessing the array, in a class Matrix
 
Please see the following code #include<iostream> #include<ctime> using namespace std; class Matrix { public: Matrix(); Matrix(int r, int c);//----------ov...
[3 replies] Last: What it is doing is this that it is calling the destructor of Local Va... (by sindhu05)
BucketSort, error inputting into bucket of vectors
 
I am having trouble implementing the bucket sort algorithm. The problem I am having is on line 15. I get a run-time error stating that the vector subscript is o...
[4 replies] Last: It works! Awesome, thank you for all your help! (by Jorge626)
by annw3y
Vectors in c++
 
I have two classes Book and Author. class Book { private: string title; string publisher; int pages; vector<Author*> authors; public: ...
[5 replies] Last: You have to edit the constructor to actually print out the string. Yo... (by zapshe)
FileIO using class with accompanying ccp file
 
Hi, I was assigned by my prof to write a program that takes in employee information and use them according to his specifications. He told us to instead of in...
[2 replies] Last: Holy crap dude tysm. This helps a lot. (by ptrpham1234)
Classes
 
After writing the program it shows me Punct3D: [-1.1;2.2;3.3] Sfera: [[0;0;0];4.1], instead of showing me instead of Punct3D: [-1.1;2.2;3.3] Sfera: [[-1.1;2.2;3...
[2 replies] Last: http://www.cplusplus.com/forum/beginner/269060/ (by Enoizat)
Classes
 
So i have to make a function in the Class Sfera in which i calculate the volume of the Sphere and in main function after writing sfr.volum()it should show the a...
[3 replies] Last: it doesnt work, it just cracks the code more. :( It works smoothly. ... (by Enoizat)
Void function not returning correct value
 
The program should return the total surface area, but instead only returns 1. How can I fix this? #include <iostream> #include <cmath> using namespace ...
[3 replies] Last: Two issues: 1. You're passing in the calculated base_area and side_are... (by Ganado)
Some programs for my class
 
I have been tasked with writing this program for my class for presentation of a good use of the if\else statements. However, after I input my data into the prog...
[1 reply] : I had forgotten to explain the basis of the problem. The problem state... (by diggetjuly)
Comparing user input string to input file string
 
I am having trouble with a school assignment where I prompt the user to input a country name, then compare it to a file that has country names with their capita...
[4 replies] Last: I figured a way out, I added a counter in the if statement to go up to... (by fish692)
recursion
 
when i use this code i get answer that is always a raised to b+1. why is that? when i put else statement in my power function i get the right answer? pls expla...
[1 reply] : Doesn't your compiler complain? If (b>0) isn't true ... then your fun... (by lastchance)
by mpg
selection sort -complexity
 
Write your question here. #include<iostream> using namespace std; main() { int a ={5,8,0,1,4,2,4,3,9,7}; int i,j,min,temp; for(i=0; i<9; i++)...
[10 replies] Last: I don't understand 1)for(L=K+1; L<n; L++) { //things in this body ... (by mpg)
Print out multiple matrices from a text file
 
Hello, I am trying to print out several matrices from a text file called data.txt and contains the matrix elements. The matrices will be of 4X4 dimension. The f...
[4 replies] Last: #include <iostream> #include <fstream> #include <sstream> #include <a... (by lastchance)
Some program with classes
 
So i have wrote this program and when i run it it should show(-1.1, 2.2, 3.3) but it wont run, can you help me find the mistake? #include <iostream> usi...
[2 replies] Last: Ok, i understand now, thank you very much! (by hmzi123)
by Hay9
Call function for each vector element
 
Hello, I am programming a game. I achieved to program a vector of enemy objects "std::vector <Character> Enemies;". For each enemy object element int strength,...
[4 replies] Last: Since you did ask about the at(): // using indices for (std::size_t i... (by keskiverto)
March 2020 Pages: 12345... 14
  Archived months: [feb2020] [apr2020]

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