Beginners - August 2012 (Page 6)

resizing a string object
 
Hi - I'm constructing a string object by an initial assignment and a large number of concatenations (using the += operator). After the string gets to a certa...
[4 replies] Last: I appreciate the feedback anyway; it's a good reminder. Apart from th... (by mzimmers)
by CppJim
The Very Evil Deck of Cards
 
Hello! I have been tasked with in my opinion a hard programming task. It is well, Challenging to me.(I just started C++ :P) The main goal is to print out a "...
[2 replies] Last: xD Thank you very much! (by CppJim)
by samrux
Header files and C++ files
 
Some questions: 1.-What's the difference between a .h and a .cpp, when used for functions and classes? 2.-What exactly happens when I include a file in a C++...
[13 replies] Last: You should only include headers in files that need it. IE: if main... (by Disch)
by Madguy
Boolalpha question
 
I was practicing with string methods and I wanted empty() to return true or false instead of 1 and 0 so I used boolalpha but now it returns 4098false or 4098tru...
[4 replies] Last: Yeah you are right, thanks (by Madguy)
sorting of classes not working
 
Hi all. I have a class "ExampleSentences" with a private member std::string _simpHanzi; I have another class "Vocabulary" with a private member std::ve...
[9 replies] Last: Did you added const to getSimpHanzi() in the declaration and definitio... (by R0mai)
by Ch1156
Polymorphism program questions (1,2)
 
Ok so i was watching this video on polymorphism and it was way better than the others, i kind of understand stuff better but there are some things im confused o...
[21 replies] Last: I also agree with naraku9333. You don't want to get ahead of yourself.... (by coderguru)
warning: adress of local variable '<variable>' returned
 
I am trying to pull from my .bashrc an environment variable CUSTPATH. I want to store the various directories in this variable in a vector and then return a poi...
[1 reply] : The error is just what the warning says. You're returning a pointer to... (by Athar)
Question about class access functions
 
I'm trying to make a relatively simple game, and i'm working on how the inventory system will work. The "loot" in this game is actually paintings, and I have my...
[2 replies] Last: so i can embed setOverallCondition() to run at the end of addAbuse()? ... (by EindacorDS)
by guyu
C++ primer 5th. Bad book? examples inside
 
I am on pg 70. Already they have stopped giving source code and there is not answer key. Seems like i am reading tons of definitions with out applying them to...
[3 replies] Last: Have a look here: http://stackoverflow.com/questions/388242/the-defin... (by closed account o3hC5Di1)
by Aceix
Aid needed
 
I want to know why the print function displays val1 and val2 wrongly Code: #include <iostream> using namespace std; template <class> void print(); ...
[3 replies] Last: Thank you all. It's working perfectly!!! (by Aceix)
Creating "map", problem with array in a class?
 
Okay, so I'm working on a school project. It's a text-based RPG, and I want to have a "map" that the player can traverse through (not a physical map that shows ...
[1 reply] : Hi there, Try doing the following: Map1.h: #ifndef MAP1_H #define ... (by closed account o3hC5Di1)
Undefined reference to error
 
Hello there! i haven't written any c++ code in 3 months, so I'm little rusty. but today I opened an old project and tried to compile it and I got this error: ...
[3 replies] Last: Most welcome, glad I could help. Have a nice day, NwN (by closed account o3hC5Di1)
Avoid prev/next pointers on a really big list?
 
I want a std::list<Node> with 10(at least) to 4000000000(at ambitious) elements. sizeof(Node)=24. Standard allocator works with one new per element, and...
[2 replies] Last: Maybe a disc based random access db such as Berkeley DB http://en.wik... (by mik2718)
Knowing which exception to catch
 
I am not fully understanding exception handling. My situation is as follows. I am trying to take an input to a program and parse it into an int. I am using a...
[3 replies] Last: cannot figure out what kind of exception atof throws and how to stor... (by Cubbi)
2D platformer game
 
Hello, I'm still working on my 2D platformer game using SFML. I would like to ask, should I have a sprite for every tile I draw on the screen, or should I use o...
[6 replies] Last: Ah, sorry. I was checking for collision only with the surrounding tile... (by Wisely Done)
by Aceix
I need some clarification please
 
This is giving me some kind of error I do not understand: //class templates & friend functions #include <iostream> using namespace std; void print(v...
[8 replies] Last: Friends are indeed not actual members of classes (although I'm not sur... (by closed account o3hC5Di1)
by ts4525
Question about arrays
 
I am reviewing some C++ code and ran across the following line of code: class->method(label, array + integerValue) the code in question is: array + integer...
[2 replies] Last: Hi there, Let's say integerValue has value 25. In that case what the ... (by closed account o3hC5Di1)
by xzbit
using class library..help pls
 
hello, i have these two projects one is a class library and the other one is a WinForm.. i add the Class Library in Winform as reference and so on.... in Class...
[2 replies] Last: i already tried that first and got me an error,,i forgot to add ^ symb... (by xzbit)
loop question.
 
How can i loop the question whenever the user inputs an invalid answer. for example.. /* question #1 */ cout<< "#1. 5+5=?" <<endl<< "A. 10" <<endl<< "B. 2" <...
[3 replies] Last: the easist way but the dangerouest way: goto sentance maybe worked,but... (by ghking)
by zkl
Data type and its size
 
Hi, Can someone explain to me this data type and size. double denominator, numerator, result; Is it about having these numbers in decimals and not whol...
[7 replies] Last: Thanks for the explanations :) (by zkl)
August 2012 Pages: 1... 45678... 45
  Archived months: [jul2012] [sep2012]

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