Beginners - September 2016 (Page 5)

finding the first character in a word?
 
Hello, I am very new to c++ and I was wondering if anyone was able to help me out! Essentially, what my program needs to do is read a .txt file with a message a...
[no replies]
Integer To Roman Numeral Converter HElP
 
#include <iostream> #include <string> #include <algorithm> #include <ctime> using namespace std; int main() { bool game = true; do { char...
[3 replies] Last: Thank You for the help. (by fivestar)
removed
 
The second pen order overwrites the first value of $1.20 in totalPen, so the code at the end is only adding up these values: 2 notebooks = $3.00 2 pens (with t...
[1 reply] : @ wpark6765 What you have done is not likely to make you friends -- a... (by Duthomhas)
What is a translation unit ?
 
What is a translation unit? What does it mean when a function is not used in the translation unit?
[5 replies] Last: http://www.cplusplus.com/faq/beginners/multiple-sources/ The compiler... (by Duthomhas)
Error when calling constructor....
 
Date.h class Date { #include "Date.h" using namespace std; public: Date(); Date(unsigned int year, unsigned int month, unsigned int day); privat...
[1 reply] : I can't say exactly what caused the issue in your code, but the error ... (by EtDecius)
by njenn5
"function does not take 0 arguments"
 
I'm just trying to get through this class, but I'm starting to struggle with basic things. This is the only error I have showing on my "radius = getRadius();" ...
[3 replies] Last: double findArea(double area); double findCircumference(double circum... (by integralfx)
stringstream converter isn't working
 
Hey all, So I'm a beginner at this and the concepts are a little hard for me to grasp. But anyway, I'm using a stringstream converter to turn the last 3 dig...
[5 replies] Last: Thank you so much! (by peasforbrains)
Output only certain numbers of counter
 
I have been searching for hours and can't find help. Please help. I know it's gonna be some simple trick, but when you have no clue what that trick is, it might...
[3 replies] Last: Thank you SakurasouBusters for the offer and thank you EtDecius for th... (by mechengvic)
Help with switch statement
 
Hello I am having trouble with my C++ homework as I do not fully understand how to use a switch statement on this problem or at all. The question goes like this...
[3 replies] Last: This is what I have so far but I do not know how to assign the convers... (by swigert93)
Overloading operator< for pointers to Objects?
 
Check out the simple code below: #include <iostream> #include <vector> #include <algorithm> class A { private: int val; public: //c...
[9 replies] Last: Taking a reference does not prevent from providing a pointer. (by keskiverto)
How to properly design objects
 
One thing I really struggle with is OOP. I don't know why it just doesn't click. I can program "Top down" all day without fault, but when trying to separate out...
[2 replies] Last: Your decision to use pointers over real objects depends on your idea o... (by mbozzi)
by suppa
Storing multiple 2D arrays in an array
 
Is there a way where I can store multiple 2D arrays into another array like a vector? something like myVector .getdata(x,y);
[no replies]
midterm help. (1,2)
 
I'm taking C++ class at college currently online and the teacher does not teach, just gives us powerpoints and says good luck. I've scraped by for now but I ...
[20 replies] Last: Any responses to Switchy is going to keep him trolling so you might as... (by diemfdie)
by lavek
delete of memory
 
Hello everyone, I have a question. HumanPlayer is a class and players is a vector<HumanPlayers*>. for(int i = 1 ; i <= num ; ++i){ players.push_back...
[1 reply] : With this code am I able to delete all the vector's elements previous... (by AbstractionAnon)
strcpy
 
I'm trying to make a function that copies a string to another string, but my output isn't right. What am I doing wrong? #include <iostream> using names...
[6 replies] Last: I see, I used the forward slash by mistake. Thanks for helping! (by cpp1024)
by ahutch
C++ Cin Problem!!!
 
When I run this program and call the function BacteriaVariables, the program stops running before inputing the variable. If I print the variable n afterwards it...
[1 reply] : Your prompt for k says "[0.0-1.0]", but k is an int. It will not hold... (by AbstractionAnon)
Pointers
 
int *e=&a; How do you translate the above in english? Is it the value of e is equal to the address of a, or something else?
[1 reply] : Is it the value of e is equal to the address of a Correct. ... (by AbstractionAnon)
by Houd
Direct Access to a Class Public Variable From Other Classes
 
Hi, is there a way to access a class public variable directly from another class? class Class1 { public: int x =0 ,y = 0; }; class Class2 { ...
[2 replies] Last: As I said, I do not know which variable will be needed to be changed f... (by Houd)
by Beez
Segmentation Fault (core dump)
 
I'm creating an ADT Bag and have to dynamically allocate size for arrays. Once the array becomes full I need to dynamically allocate more space for it, so it ca...
[1 reply] : Line 21/49: You copy the new size while it should be itemCount . ... (by coder777)
I used printf and scanf in c++ codeblocks now trying to change Variables to cout and cin lots of issues with my change machine
 
Errors error: no match for operator>> in std::cin >> "%d" #include <iostream> using namespace std; int main(void) { int change; int coins; ...
[7 replies] Last: You have been asked multiple times to use code tags. PLEASE DO SO. ht... (by AbstractionAnon)
September 2016 Pages: 1... 34567... 34
  Archived months: [aug2016] [oct2016]

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