Beginners - July 2013 (Page 32)

More then one word stored in a string
 
How do you do a strin(header <cstring>) that you can use two works. because im making a text adventure and i want to do "flick lightswitch"
[4 replies] Last: I would highly suggest you learn about C++ strings which will make thi... (by closed account 3qX21hU5)
Storing values in an array
 
Hello, I am a complete beginner and need some help on creating an array (or at least I think it is an array I want to create!) I am getting a string of va...
[2 replies] Last: You don't need a array at all if I am understanding you right. Basica... (by closed account 3qX21hU5)
Can't Figure Out How To Not Use System()
 
Hello, I am sort of new to programming and have been working on a Tic Tac Toe game. I used evil system() a ton of times and didn't make this program code very...
[3 replies] Last: Last part: a == 1 && ba == 1 && ca == 1) { system("color 60"); ... (by Nedra144)
finding 1st digit of an int using recursion
 
When I step thru my code its working, but then it spits out garbage! I don't know what I am doing wrong... int firstDigit(int NBR) { if(NBR!=0) { ...
[8 replies] Last: @ Smac89 That would probably be harder to do if you're a beginner.... (by GoranGaming)
If/Else Statements Are Not Working
 
When i run the program if i enter north/south it will just go to the system("pause"). can someone help! int main(){ char direction ; char action ;...
[1 reply] : This expression if (direction == "north"){ is always false because t... (by vlad from moscow)
Need help with reading data from a file while loop
 
We just started class today and im having major memory blockage when it comes to programming even though the last class was only a few months ago... Pr...
[2 replies] Last: yea it needs to check all the numbers and dates given to make sure its... (by trut1992)
by Rukky1
Iteration structures
 
Hi, i am an absolute beginner in c++. Can some one please help explain in brief, do....while loop and for.... loop.I have understood that while loop continue t...
[no replies]
by viti
std::bad_alloc
 
Hi there, I'm getting a strange error with the program I'm writing: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_allo...
[1 reply] : Well, std::bad_alloc is saying you've not got enough memory to provde ... (by andywestken)
A few questions
 
1. How do you know wide character, long and long double they have the same suffix. How do you differentiate? 2. What is integer literals and decimal literals?
[no replies]
Stack Overflow, but allocating on the heap...
 
Hello, Im getting this error when I type this: p = new Player(window, clock, windowEvent, view); . This is allocating on the heap, correct? So, why would somet...
[16 replies] Last: Oh, i see. Anyway, I am using a graphicl library already (SFML). Ok, t... (by closed account LN7oGNh0)
Need for const functions
 
Hi, Suppose I have a generic class class Foo { private: int _member1; float _member2; public: Foo(int m1, float m2) : _member1(m1), _mem...
[1 reply] : Read the FAQs in this section: http://www.parashift.com/c++-faq-lite/c... (by JLBorges)
by Nebur
Chess board program not working for large integers
 
Hi everyone, I am trying to write a pogram in which first, you are given the description of a chess board (f rows and c columns). After, follows f lines with c...
[5 replies] Last: Again thanks a lot for those fast answers, you helped me a lot! (by Nebur)
Class Definitions
 
I am in the middle of debugging my project and I can't figure out for the life of he how to correct some of the errors Our assignment is as follows We are to...
[2 replies] Last: this-> IS AMAZING Thank you I was able to figure it out except for... (by rezivor)
by klando
std::getline ignores tabulator
 
Hi, I searched/googled for some time now, but found nothing regarding this problem: When reading lines from a file with getline(), all tabulators are missing. ...
[4 replies] Last: That produces "tab" twice. As it should, I reckoned. And now, after a... (by klando)
Random Numbers
 
How to Program a C++ function, int bigRand (), that generates non-duplicated big random numbers in the range of 0 .. BIG_RAND_MAX (where the BIG_RAND_MAX is def...
[1 reply] : #include <numeric> #include <random> #include <ctime> #include <algor... (by JLBorges)
How to assign a const char* to char*
 
I'm writing a code in which I have to pass a const char* into the class overloaded constructor and to assign this const char* to the char* variable which is a p...
[1 reply] : you shouldn't assign the pointer. Instead copy the content. You need o... (by coder777)
Very Lost on Classes
 
From this point on in our course over the next several weeks we are going to be concentrating on classes-- I am finding it INCREDIBLY difficult to make sense o...
[9 replies] Last: ¿do you know what this is? ¿why is `displayStats()' taking a param... (by ne555)
Confused on Class definitions
 
From this point on in our course over the next several weeks we are going to be concentrating on classes-- I am finding it INCREDIBLY difficult to make sense of...
[1 reply] : I've since updated this as such I am still not quite sure how to impl... (by rezivor)
need help to enhence this program
 
Hi, the code below is a simple program. this is my question and problem 1: how to disallow the user to input char or string? 2: disallow the user to enter a ...
[4 replies] Last: change line 6: float cost (float choice) and line 35 as follows:... (by condor)
typedefs and structs
 
Is the combination typedef struct used in C++? On MDSN I see stuctures under C++ code with typedef structs. I read that it was used in C to avoid typing struct ...
[2 replies] Last: I read that it was used in C to avoid typing struct everytime you nee... (by Disch)
July 2013 Pages: 1... 3031323334... 53
  Archived months: [jun2013] [aug2013]

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