Beginners - June 2009 (Page 13)

Vector inheritance question
 
I was just wondering if this would work: class a { int a; }; class b public a { int b; }; int main() { vector<a> listOfStuff; ...
[5 replies] Last: @return 0: Yes actually, was it obvious from Item and Itemtype? Tha... (by awasteoflife)
by Nelo87
How to make a number like this "07.00"
 
I have to make a program where my input should be 07.00 instead of 07:00. I'm talking about any number. I tried using the setprecision manipulator, but it doe...
[4 replies] Last: Remember to use cin.ignore(); after line 19. Your program will proba... (by mcleano)
by wretch
char *str1 = "abcd"; str1[2]='x'; compiles?
 
#include <iostream> using namespace std; int main() { char *str1 = "abcd"; const char *str2 = "efgh"; str1 = 'x'; //str2 = 'x'; compiler ...
[5 replies] Last: I'll wait 'till I have a few more months C++ under my belt before I d... (by mcleano)
by GKMPRO
Hello World
 
I am just starting C++ and already i cant even get past the very first program. this is the code: #include <iostream> int main (); { cout <<"Hello Wo...
[2 replies] Last: What he said, either put using namespace std; after your heade... (by jloundy)
the 0, not easy
 
hey everyone,now I have a question about... see /*zenoc's paradox *this program calculate the sum of 1/2, 1/4, 1/8, 1/16 ... */ #include <iostream> ...
[5 replies] Last: This series asymptotically approaches 1, which means that f(n)=sigma(i... (by helios)
Game Inventory System
 
So I've been trying to decide how I will write my player inventory system and I've tried it several ways, all of which haven't satisfied me. So I would like so...
[4 replies] Last: Ok. I'll focus my efforts on a vector design then. Thank you for you... (by Return 0)
About the Boost C++ Library...
 
Can it be used with MVC++ 6?
[8 replies] Last: 2005 SP1 http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4... (by Tevsky)
how to with function?
 
hello, I can't figure it out, how is the right way? char instead of string? pointers?, class? Thanks #include <iostream> using namespace std; string ...
[1 reply] : char instead of string? pointers?, class? Just naming off random ... (by Tevsky)
Template class and arrays...
 
Okay, so, say I have a template class which holds a pointer to a dynamically allocated array. The type of the array is determined by the template. What I nee...
[7 replies] Last: Hey everyone, thanks for posting. Turns out it was a simple off-by-... (by PlasmaCube)
What is a stream exactly?
 
Hi, im just beginning c++ and been reading regarding cin and cout. After reading the chapter, I just got curious what acually a stream is. It is said in some as...
[2 replies] Last: Hi jsmith, Thanks for the reply. I did some researching and you wer... (by gnobber)
having trouble with a persentage
 
how do I round up to a whole number?
[2 replies] Last: Thanks that worked perfectly ;*D (by fire child)
I can' find my errors in basic C++
 
I have programed before but it's been over 2 years so I tried thing I could remember but nothing is working for me. I started over with hello world but again it...
[8 replies] Last: try using cin.get() lol (by jloundy)
Prime numbers
 
Hi everyone, I started programming C++ a few months ago and I want to make a program that uses the sieve of Eratosthenes to determine prime numbers. I have l...
[9 replies] Last: #include <iostream> /*********************************************... (by closed account z05DSL3A)
by Joe101
Basic Inheritance Question
 
I have a class Duck that extends Animal..can anyone tell me why the line near the bottom ( see the comments) gives the following error: ISO C++ forbids initia...
[3 replies] Last: thanks! (by Joe101)
This code, which does not work
 
This could should generate a random string. I was looking it up on the internet and decided to rewrite a program -- to see how it works, and therefore learn. ...
[1 reply] : Be careful with that cin.get(). std::cin will leave a newline in the i... (by helios)
by Ultima
Vectors and Collision
 
Hi there! I am making a 2D pool game and I need some help with the formulas for calculating where the ball will go after collision. Here's an extract of my c...
[9 replies] Last: He's just looking for a calculation of the resulting velocity vectors ... (by Hammurabi)
Toggling -1 and 0 using single line of code
 
Hey everyone, I'm a beginner in programming and I want to know how you can toggle -1 and 0 using just a single line of code. I know you can do it with 'If'...
[4 replies] Last: Yes, quite a few, but they are increasingly uncommon. (by Duthomhas)
What am I doing wrong here?
 
I'm just trying to do a simple program to find the sum and average. It seems right to me, but apparently I've got an error with my identifiers. Here is my progr...
[5 replies] Last: You need to change your int average to double average so it can... (by jloundy)
by menna
bitmap plz
 
the code doesnt work plz i dont know where is the wrong. / tring.cpp : Defines the entry point for the console application. // #include "stdafx.h" #i...
[5 replies] Last: Turn the bitmap read for me, well it did once I made sure the bitmap f... (by closed account z05DSL3A)
by alanor
Abstract identifiers...
 
Hi, I'm pretty new to C++, hence why I'm posting in the beginners' section. This may seem like a stupid or obvious question, but is there any way of manipula...
[2 replies] Last: Ah, this looks promising. Thanks for you help, Helios. (by alanor)
June 2009 Pages: 1... 1112131415... 18
  Archived months: [may2009] [jul2009]

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