Beginners - July 2013 (Page 44)

How to create this dynamic char array to save memory space?
 
Hi there! I have created a simple console-rpg-battle simulator and I need to recreate the name so it is gathered dynamically, not to take up more space than nec...
[2 replies] Last: Thanks mate, I'll give this a try right away. :) Highly appreciated! (by Farzanzand)
by Larry2
wrong result
 
Hello ! I wonder why i get a wrong result : #include <iostream> using namespace std; int main() { int s = 5; for (int i = 1; i < 1000000; ++i){ ...
[3 replies] Last: i would suggest that you use long int rather than double, if you reall... (by Rechard3)
Is there a simpler way for me to make this?
 
it just takes a long time to write all of the if statements that my probalam. #include <string> #include <iostream> #include <ostream> #include <cstdlib> ...
[7 replies] Last: Have you tried following the C++ language tutorial? http://www.cplusp... (by Megacaesar)
Logical question with classes
 
I have a base class called Object, and two classes drivied from Object called Weapon and Armor. I want a vector that acts like an inventory that can hold both W...
[5 replies] Last: the approach i advice: use runtime polymorphism, declare all the need... (by mutexe)
Learning template programming
 
Hi, I am trying to learn C++ programming and I am now looking on how to use templates. My code looks as follows, I have one file called first.cpp and one cal...
[5 replies] Last: Yes, sorry about that. (by Chervil)
How to write this?
 
I wanted some guidance in doing the hotel management program. Here it is { clrscr(); int r,flag; ofstream fout("Record.dat",ios::app); cout<<"\...
[4 replies] Last: Jaybob66 (28) Thx a lot for ur help! God bless!! JLBorges (2727) Thx ... (by djferreira)
by Ch1156
Vector is crashing program
 
I made a vector and i wanted the user to enter names and then stop to stop, but after i do that the program outputs what i entered then crashes. It says the pro...
[5 replies] Last: In c++11 you can do like this: std::vector<std::string> svec; svec.... (by gemic)
Tic-Tac-Toe questions
 
I'm making a C++ game for an assignment. This is what I have so far (its far from complete since its a group project). I'm missing some functions in here becaus...
[5 replies] Last: The problem may be in the following if statement, which looks weird to... (by MikeyBoy)
by xspec
need help with error with my code
 
i cant figure out the error with this code im a beginner so i know its probably a easy solution can someone please tell me the solution here's the code #i...
[3 replies] Last: did you ever program in python? those mistakes look pythony (by closed account Dy7SLyTq)
Indeterminate Input
 
Hello! In my program user inputs 1 or 2 integer variables(sometimes 1 and sometimes 2). int a, b; cin >> a >> b; or int a; cin >> a; ...
[4 replies] Last: @Zhuge, @DTSCode: Thanks. I've done it this way and it seems it works... (by Olia Pavliuk)
program bug
 
i'm writing a program to obtain elements of an array as input from a user. i was able to figure out how to write everything, but when i run it the program crash...
[5 replies] Last: try -std:c++11 (by closed account Dy7SLyTq)
error LNK2005
 
Hi. I have this code and it doesn't work. I need help. Someone can explain why it doesn't work? Thank you. //Error.h #ifndef CACL_ERROR_H #define CA...
[5 replies] Last: Thank you. It work :happy: (by vuonganh1993)
reformating using array of string.
 
Hello everyone, I'm trying to read in a string of names and reformat them so that the first letter of the first and last name are uppercase and rest are lowerca...
[6 replies] Last: Here is the example from http://www.cplusplus.com/reference/locale/tou... (by condor)
by jt1841
Overloading operator[]
 
So I believe I'm on the right track here but I'm not the best when it comes to C++. I need to overload the operator for a Matrix class. The project and code i...
[5 replies] Last: The signature of your function (which you cannot change??) looks a lit... (by andywestken)
by cgwood
Please help with tic tac toe
 
Please help me. I have been working on this for days and I am simply lost now. I have searched all over the net trying to find the answers myself and it has onl...
[1 reply] : To put it simply, this program is a mess, and by that I mean that you ... (by meesa)
Sentinel Controlled Loop
 
Why do I get a blank screen whenever I try to run the below code? Is it something wrong with the function at the bottom I declared? #include <iostream> ...
[7 replies] Last: Speaking of which, why would someone use an Inline Function? I read th... (by DanielPatrick)
Pass by Value Pass by Function
 
Hi, I started writing a program to calculate tuition for a school-- Upon completing I am realizing I need to rewrite it to make pass by value/pass by functio...
[1 reply] : You have a logic problem with every one of your switch statements. If... (by AbstractionAnon)
What is signed and unsigned?
 
Hi there i just have a simple question What is signed and unsigned?
[5 replies] Last: Helpful to me too. Thanks Disch. (by heyyouyesyouiloveyou)
Im Lost! Please help
 
I have been using "programming principles and practice" by Bjarne Stroustrup (the author of c++) I was doing fine, until all of a sudden, in chapter 5 (where h...
[3 replies] Last: if i may suggest, try reading C++ the complete reference: Herbert Sc... (by Rechard3)
Creating Binary Tree from a file.
 
I am trying to get the program to read a text file that has question and answers and depending on the response, moves to the (preorder) node. I get the program ...
[1 reply] : Well it looks like ur erasing the q/a so the first character will be w... (by closed account Dy7SLyTq)
July 2013 Pages: 1... 4243444546... 53
  Archived months: [jun2013] [aug2013]

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