Beginners - January 2013 (Page 45)

Create objects unsing for
 
How do I create objects from a class, using a for, like: Let's say I want to create object1, object2, object3, object4,...,objectN How do I proceed? ...
[1 reply] : You can crate an array or <vector> or <list> or any other container of... (by TheIdeasMan)
Going back in istringstream
 
Is there a recommended or easy way to make an istringstream go back to before the last extraction performed, so it will extract the word again? I tried with se...
[2 replies] Last: Thank you, worked perfectly. (by maeriden)
by nueur
2 Dimensional array: strange values?
 
Hey guys, I'm new to C++ and am getting confused while trying to use a 2d array. Here's my code: int testArr = {0}; //test values testArr = 1; ...
[3 replies] Last: No worries - any time, just mark the thread as solved, and we will cat... (by TheIdeasMan)
saving and loading text game
 
I just got "Sam's teach yourself c++ in one hour a day" for Christmas and its taught me quite a bit, however, I looked ahead in the book and it doesn't seem to ...
[10 replies] Last: hi, i'm also doing a text base game.step by step. the code is show bel... (by lucan74)
Problem with a loop
 
I am working on project Euler problem #4 which states: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digi...
[4 replies] Last: If you say T array ; //N is a constant you've got an array with `N' ... (by ne555)
by M321
structs and pointers?
 
Could someone help me understand what is going on in the following code? struct Abc // this I understand { Abc() { } int num; };...
[6 replies] Last: Thank you all for your replies. I now have a much clearer understandin... (by M321)
Array vs Element
 
What is the difference (according to my C++ compiler) between cout << cnArray; and cout << cnArray ; assuming that cnArray is declared and defined as ...
[12 replies] Last: This is perhaps a more realistic example, though std::string etc might... (by Chervil)
enum
 
With regards to C, not C++. . . . #include <stdio.h> /* To shorten example, not using argp */ int main () { enum compass_direction { north, east...
[2 replies] Last: In C enumerations belong to integer types. Rach enumerator has type in... (by vlad from moscow)
How do i create multiple files in/from ofstream?
 
Hello everyone,I have a question on file manipulation and would like to know how could i create multiple files from ofstream. For example in the code below whe...
[3 replies] Last: #include <fstream> #include <iostream> #define TRUE true int main()... (by closed account 18hRX9L8)
NEED HELP FOR OOP C++
 
I really need your help guys! I need a sample or the SCRIPT for simple input output in OOP style in C++. This includes "class". For example, I need to input my ...
[4 replies] Last: So the outputs of the Name, Age and Bday need to be presented just lik... (by PatricBernard)
Waiting for input in SFML
 
Hello, I'm currently writing a 2D mini-game using visual studio 2012 and SFML 2.0 in which I required a section for the beginning of the level to prompt the use...
[1 reply] : You aren't polling events. You aren't sleeping. You're just running ... (by cire)
simple input/output in OOP style
 
I need a script in OOP style :( this is what i need to do... Name: ______ // input name Age: _______ // input age Birthday: ______ // input bday and wil...
[2 replies] Last: Duplicate post see 524 (by bobdabilder)
Program won't wait for user input
 
Hello, I've just started learning c++ and for my first attempt at it I thought I'd make a program which calculates final velocity when given initial velocit...
[5 replies] Last: Thank you Chervil! That was indeed the problem. I was trying it with a... (by Marius11)
I need syntax help!
 
// What do the following code snippets do? ::TranslateMessage( &msg ); /* It seems to be a class method. It's in a class definition. Why the double co...
[2 replies] Last: Thank you VERY much! :) (by myclone)
using 2d array
 
I wonder Whether code 1 is right or wrong and then if it is efficient or not? one more question if code 1 is right then why #floating point ops in code 1 and 2 ...
[6 replies] Last: for example code 1 floating point operation result for size 16 is 24... (by para1131)
print your name by starst with diffrent colors
 
i have this code it prints your name by 8*8 matrix stars and i wanna to have it with diffrent charactar colors for each matrix blocks please help me :-(! #inc...
[1 reply] : @lsamanl You didn't need a different function for each letter, since ... (by whitenite1)
by ReDoX
Help with my Factorial Program
 
I'm very new to C++ and I'm making a program that calculates the factorial of a number. Just in case someone doesn't know, the factorial of a number is the sum ...
[4 replies] Last: Actually that's the sum of the integers. The factorial is the product... (by nathan10)
by Zemmi
Some newbie questions about C++ as a whole
 
Hey guys! I study game design and development, am in my first year and I really want to focus on programming. So far I did pretty basic stuff in Gamemaker an...
[4 replies] Last: Thanks guys, I didn't really get the fact you need an API to communica... (by Zemmi)
by Hotice
Vectors, trees, and dynamic memory
 
Suppose you have a node defined like: struct node { string value; vector <node *> subnodes; }; //end node that you used to build a tree. Now, let'...
[11 replies] Last: I would've gone with something more like the following. Notice that n... (by cire)
by jorz
fopen
 
Hi all, I would like to use openFileDialog to select a file to open and after that I would like to open this file with fopen or ofstream how can I convert th...
[1 reply] : solved http://www.cplusplus.com/forum/windows/10914/ (by jorz)
January 2013 Pages: 1... 4344454647... 52
  Archived months: [dec2012] [feb2013]

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