Beginners - July 2012 (Page 3)

by Ch1156
Array in class
 
I have an array in my class but i cant figure out how to use it in my program, i fixed some issues with ti before but still cant get it to work #include <ios...
[4 replies] Last: Hi there, The example Mr. Moschops gave uses dynamic memory: http://c... (by closed account o3hC5Di1)
Please help me check what's wrong
 
#include <iostream> class Tricycle { public: int getSpeed(); void setSpeed(int speed); void pedal(); void brake(); private: int speed; }; int Tricycl...
[3 replies] Last: Thank you for all your input. I've solved the problem (by michael370662)
2 issues I cannot figure out
 
#include "stdafx.h" #include <iostream> #include <fstream> #include <iomanip> #include <string> #include <algorithm> using namespace std; // global ...
[11 replies] Last: I am so glad I could help! :) Don't forget to mark the thread as "solv... (by closed account j2NvC542)
inheritance
 
i am making a program to store data of bank #include<iostream.h> #include<conio.h> #include<string.h> class bank_entry { protected: char ac_holder,address; lo...
[9 replies] Last: Try VC++ (by Akshit)
by beakie
"infinite" amount of params like printf... how to?
 
How do I make a function with an unspecified amount of parameters... like printf does()? Cheers
[2 replies] Last: In C++11 you can use variadic templates. The advantages with this appr... (by Peter87)
by beakie
How to call another constructor?
 
How can I call a constructor from a constructor? Txt::Txt(int i) { this->Txt(""); };
[2 replies] Last: In C++11 you can do it like this Txt::Txt(int i) : Txt("") {} ... (by Peter87)
Proper commands for making games
 
I've been surfing around the internet and these forums and from what I've seen using cout/cin is not considered the "right" way to code. I've seen multiple answ...
[4 replies] Last: cin and cout is great because they are standard and works on every C++... (by Peter87)
by ToniAz
Default Parmeters for Function/Struct in C
 
Hello Everyone! I'm really not sure if this issue is compiler dependent, or language dependent. I remember that in C++, you can declare a function header wit...
[1 reply] : you can't have default parameters for classes or structs. You can prov... (by coder777)
by beakie
ASIN / NAN
 
1) Why does asin(28.867514) not return a number? 2) How can I check for -1.#IND000 in c++?
[3 replies] Last: See here: http://www.cplusplus.com/reference/clibrary/cmath/asin/ (by guestgulkan)
Nested Lists: how to add an item to a list of Lists
 
Hi guys, I am new on the board. I am learning about list of lists. I am trying to add elements to a list which is part of a list of lists. I have noted ...
[1 reply] : list<item> listEntry // in the "for" loop is local variable and just m... (by Benjay)
Class problem
 
Can someone point me in the right direction please? I think I have made a simple mistake but I can't figure it out to save my life. Thanks, Nick dictio...
[3 replies] Last: Thank you Moschops, declaring the namespace fixed most of the problems... (by i2Fluffy)
by mgbuhj
can't open output file!
 
I've been trying to compile this code for quite a while now, and I'm still having errors. The code now compiles fine, but it releases no output on the console,...
[4 replies] Last: What do/did u want line 61 to do ? Did u try ne555's suggestions ? (by soranz)
I am having issues with my C++ coding . Any Advice?
 
Can anyone give me advice or guidance with this C++ program, i keep getting errors, and I'm not sure why? Thanks!? I have all of the code written up and ill pr...
[1 reply] : Hi ! Please use code tags to format ur code I'm having trouble unders... (by soranz)
by mgbuhj
extracting data from a file to do calculations
 
I'm trying to write a program that opens a user-defined file (when prompted), and within that file there are a few lines each consisting of: a name, Social Sec...
[3 replies] Last: Your if statement is still messed up. 75) Still has an extraneous br... (by AbstractionAnon)
Creating an array of pointers.
 
Hello again, I'm working on concept of RPG text game. I decided, that class Location should have many members, and I'm not sure if I'm going right way. For...
[3 replies] Last: Thank you all for your help. I guess I will give vector a try. :) (by MatthewRock)
application doesn't run outside of IDE
 
I have built a sdl based game which runs fine in the IDE (codeblocks) but not outside it (be opening the .exe in windows). I'm fairly sure I have all the dlls i...
[3 replies] Last: Code::Blocks doesn't close your program at the end and waits for you t... (by MatthewRock)
Pointer to a function used in arithmetic
 
Hello everybody. First post here. Wonder if you could help me with this warning: pointer to a function used in arithmetic. When I'm running the program it crash...
[3 replies] Last: That is one thing I forget about, so I just always do int main(int ar... (by BHX)
by beakie
Returning classes from operator+ ... error
 
I have built a class to handle char pointer arrays. The code errors on the return from the operator+. It is executing the deconstructor of temp before lea...
[1 reply] : If you need a destructor, a copy constructor or an assignment operator... (by ne555)
Zombie game script failing
 
I've been writing a simple text-based zombie survival game. very simple if your experianced. one big concept is meals. when you go out and scavenge, the meals y...
[2 replies] Last: thanks, and i will try to (by tillo25)
Copy constructor
 
Why do we bother and make a copy constructor in a class? I did not understand the documentation attached to this topic. Thank you
[2 replies] Last: Thank you a lot! (by gethelpcpp123)
July 2012 Pages: 12345... 54
  Archived months: [jun2012] [aug2012]

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