Beginners - January 2011 (Page 28)

While loop pausing, or ignoring the loop condition all together.
 
Hi, at the moment I am doing a independent study to learn C++ and right now I am stumped by a financial planning assignment. I've asked my teacher and I've look...
[4 replies] Last: *Facepalm* Alright, thank you all so much. It works now. Also, sorr... (by Popplelopolis)
Problem with conversion programme
 
Okay, I'm working through Bjarne Stroustrup's Programming: Principles and Practice using C++ (really enjoying it!) and I've completed the first "Try This" exerc...
[3 replies] Last: Cheers for the replies, guys. @Albatross - I've heard of std::strin... (by declanmcerlane)
concat char *
 
class myString { private: char * str; public: myString(){}; myString(char *); ~myString(); int compare(myString); int length(); ...
[3 replies] Last: For the first question: A 'char*' is a 'char '. The problem is you ca... (by sadavied)
const void * to std::wstring
 
Hi, So I've been reading up on void pointers and understand that it lets the compiler know it points to a variable of unknown type, but how to manipulate the...
[4 replies] Last: I've been meaning to write a small lightweight UTF conversion lib for ... (by Disch)
feof reading last line twice
 
I am using this code to read in some lines: while(!feof(fp)) { fscanf(fp,"%s %d %d %c",word,&x,&y,); printf("%s %d %d %c\n",word,x,y,...
[4 replies] Last: In Bazzy's example, you read from the file, then exit if you are at th... (by Zhuge)
Why can't I access private members in a derived class?
 
My book says it right here, like so: //Base class declaration class Person { public: const string& NameIs() const; void change_name(const string& ...
[2 replies] Last: That solved it. Thanks! (by Metallon)
Fusion sorting algorithm
 
Is this the correct way to implement a function that uses the fusion sorting algorithm to sort a vector of doubles? #include <iostream> #include <vector> ...
[no replies]
What that means ?
 
plz help explain to me these lignes 11 56 75 95 101 class Enseignant { int PPR; char Nom ; char Prenom ; int Nb_mat; ...
[2 replies] Last: Your class thinks that it's an array of object of the same class (by ne555)
Should this function be a member function or friend?
 
So I have a function that looks like this at the moment: void Player::Betting () { do { std::cout << "\n Place your bets: "; std::cin >> myBe...
[4 replies] Last: I think I'll make Betting a member function of Player. "Messy" thou... (by Metallon)
what does this code do?
 
Hello I am new to C++ and i am reading a tutorial and in the tutorial there is code about: cin.getline. And this the part that i don't understand: ...
[3 replies] Last: Thanks Guys i get it now thanks to your . (by hitmanben2)
by sponky
game network libraries?
 
Hi, Could anyone recommend any open source game network library? I need chat/synchronization/voice/data transmition on high level interface (API), but a...
[1 reply] : SFML has networking: http://www.sfml-dev.org/ (by Disch)
by qwe123
2D array/vector
 
Hi, I want to build a 2D array (or vector), which I can use as function input. So far, I have the following code, but it does not work. It gives the follo...
[1 reply] : Arrays must have constant length. See http://www.cplusplus.com/forum/... (by hamsterman)
Sort Method
 
Hi guys, is there a pre-defined sort method I can use in C++ instead of writing my own. All I want for now is to sort a list of ints. Example... int list...
[3 replies] Last: Also, std::multiset is a container that will give you this ordering au... (by jsmith)
Which things are created when an class object is created?
 
Hi Someone told me once that when an object of a class is created then 6 things are created automatically.I know the obvious 4 things: 1)constructor 2)copy c...
[2 replies] Last: What you meant was more like "Which things are created by default when... (by hamsterman)
Array
 
Hi, Trying to do something simple here but getting an annoying error - constant expression required - how do I get round this? int main() { l...
[5 replies] Last: In C++, you don't need to do that int main() { long array ; ... (by stereoMatching)
questions in vector & class
 
hello, i want to write a simple university programme please first see my code #include<iostream> #include<string> #include<vector> using namespace st...
[9 replies] Last: Ok, you may try this: http://www.cplusplus.com/forum/beginner/34289/#m... (by coder777)
by LoOpz
getline(cin,string[array])
 
Hi! I have been learning the C++ programming language thanks to this website and I am creating my own examples or exercises just to learn, so the code may be...
[2 replies] Last: Thanks, ill use it. (by LoOpz)
Reversing a word?
 
So here is my code: #include <stdio.h> #include <stdlib.h> int main() { char word1 = "hello"; char word2 ; int i,k; i= strlen(word...
[1 reply] : The end of a C-Style character string is indicated with a zero value. ... (by Moschops)
Import A tiff file
 
How can I get a tiff file into an array in C++. It is a colored image. I just want an array that gives me the color values for each field.
[3 replies] Last: Libtiff is mightily useful for importing TIFF images: http://www.c... (by Moschops)
How to make rand generation exclude certain values?
 
Simple, how do I make it so that when I randomly generate a number, it cannot generate one certain value. The point of this is so that the it does not generate...
[17 replies] Last: /**do { row1 = rand() % 9+1; } while((row1 == row1 ) || (row1 ... (by ne555)
January 2011 Pages: 1... 2627282930... 42
  Archived months: [dec2010] [feb2011]

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