Beginners - February 2009 (Page 7)

Why does string not work?
 
// Attempt to declare a string object #include <iostream> #include <string> #include <vector> int main() { std::string const end_input('END'); std::v...
[2 replies] Last: thanks - it works now. (by youknowme)
by ivitec
Im new and i need suppor
 
Hello im ivitec, Im new here at C++ but well i will start learning this new language... I was wondering if theres people who knows about a game called "Com...
[2 replies] Last: Well... i dont know how to start scripting to make it run, and i need ... (by ivitec)
by Inks04
Need to make a function
 
Hello everyone!! I'm having a small problem creating a getValue function. I think I'm making this more difficult than it should be. I think I got my error mess...
[2 replies] Last: Besides,you can use "if" instead of "while". (by cyanglee)
enumProcesses()
 
Hey, I've looked everywhere but I couldn't find the answer. I downloaded the code for enumerating all active processes on the system(http://msdn.microsoft.co...
[3 replies] Last: I think this is going away over my head. Thanks for the help, but I'll... (by nicolasfranck)
How can i get a program to decide how many places are in an input?
 
Say theyres an entered number of 14, that can be stored in a substring, and it registers as two places right? (one for 1, one for 4). now how can i make a progr...
[1 reply] : So, what you want to do is break down a decimal number to its individu... (by helios)
New to Classes
 
I have the following code.. int main { MediaClass m1; m1.InputMedia(); m1.DisplayMedia(); return 0; } I am getting an error saying: "undefi...
[3 replies] Last: Yes, that's what I meant when I said Did you define MediaClass' meth... (by helios)
by dman
Value initialization
 
Something thats very new to me is the initialization of vars etc that are not 0 or null. I assume this is because c++ just allocates a memory slot without res...
[5 replies] Last: I love it when you post boost stuff, jsmith. We don't use it where I ... (by seymore15074)
by dman
arays of pointers?
 
TEntity* camera = CreateFPSCamera(0,15,1,0); TEntity* cubes ; for (s32 a = 0 ; a< 10; a++) { for (s32 b=0; b<10 ;b++ ) ...
[2 replies] Last: ahh tx (by dman)
by dman
The null/backslash character
 
Ive got a small problem that i need to fix. I am using ifstream to readline a file full of terminated string lines that contain filenames/paths. I need t...
[3 replies] Last: Thanks thats exactly what i was after, i have written a simple functio... (by dman)
by Aztral
Object Instantiation
 
I am attempting to instantiate multiple versions of the same object, my code for that simply looks like: /* Global variables: */ SDL_Color _fg; ...
[2 replies] Last: DrawableString::DrawableString(Font* f, char* txt, SDL_Color fg, ... (by Aztral)
by masiht
the null character
 
I am reading the character sequences section of this tutorial here. It has mentioned the null character '0' but it doesn't have any example. please give me a ...
[8 replies] Last: Everything with double quotes already have a null character at the end (by Bazzy)
Problem: letters in in variables
 
Writing a Roulette simulation program. I am working on making on debugging my program, and trying to make it so it cannot be broken. I know there is some simple...
[1 reply] : I think cin.good() returns false if the last input was invalid. (by helios)
Can someone explain how this program works?
 
Heres the code my friend wrote to determine whether a year is leap year or not. #include <iostream> using namespace std; int remainder (int num1, int nu...
[3 replies] Last: On the right of your reply box, the # button. Write between the [ code... (by vorticidal)
why does this if statement not execute?
 
This is just a small program that i wrote to change any 'e's in a string to be changed to an 'E' but the quit option i wrote doesn't seem to work. #inclu...
[2 replies] Last: Thankyou :) It works perfectly now (by mcleano)
A Simple Problem
 
#include<iostream> using namespace std; int main() {cout<<-1*2*sizeof(double); cin.get();} I want to get the result of "-16" and insisted on using si...
[1 reply] : because sizeof returns an unsigned value so you have -16 unsigned ... (by Bazzy)
declare array without specified size
 
#include <iostream> #include <conio> int main() { const int SIZE = 100; char sentence ; cout <<"Enter a sentence :"<<endl; cin.getline(sentence,S...
[7 replies] Last: In C: #include<stdlib.h> int *myArray = (int *) malloc(size*2); ... (by vorticidal)
calculate the length of the string
 
#include <iostream> #include <conio> #include <string> int stringLength(char *); int main() { const int SIZE = 100; char sentence ; int count; ...
[2 replies] Last: If you want to exclude whitespace, then you need to write your own str... (by jsmith)
by tr1978
Double variable not giving correct number
 
I'm learning C++, and have a problem I hope someone can explain to me. I declare a double, enter a long number, and print it out. Look at the result below....
[3 replies] Last: doubles are usually 64 bits, not 32. floats are 32. nonetheless the ... (by jsmith)
Duplicate class registration error
 
Hi all, I have created some libraies from cpp files. i have some executables to which i link it. when iam running that executable it says duplicate class reg...
[no replies]
undefined reference to function
 
My code keeps giving me the same error....undefined reference to 'Function' I ran into this problem before and when I found the answer before it had to do wi...
[1 reply] : you have forgotten to add the & for max,min and mean when you define t... (by anders43)
February 2009 Pages: 1... 56789... 22
  Archived months: [jan2009] [mar2009]

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