General C++ Programming - December 2009 (Page 5)

by joen
What should the prototype for a function that returns a pointer to an array?
 
I declared this: char (* words) ; Now I need to declare a function that returns the variable: words . If I declare like this: char (*) GetWords(); the c...
[3 replies] Last: Cool! Thank you R0mai and kbw. :-D (by joen)
C++
 
I am stuck. This is what I have so far. #include<iostream> using namespace std; double pay(double rate,double hours); int main() { cout <<"The pay for 30 ...
[6 replies] Last: There has to be a function in the cctype header to calculate that leng... (by tummychow)
default initialization of basic types (1,2)
 
What is the default initialization of basic data types such as int, char, pointer, array in different declarations such as when declared on function stack, in c...
[20 replies] Last: Oh yeah. ():) (by chrisname)
Global Variable
 
This is my pseudo_code: Cgicc cgi; class My_Class { public: My_Class() { cgi.getFile(); } }; When I compile this ...
[6 replies] Last: This would also a possibility I think. But for the moment I don't care... (by reuabreliz)
by AYT
Can't think of a good title, but you should read me anyway
 
Hi all, I have a number of classes which are very different from each other but have *some* shared functionality. For example, some of them have an identifie...
[2 replies] Last: That works perfectly, thank you. As for building a class around hav... (by AYT)
by Alan
Tree traversal
 
I have a problem. I have a tree that i need to traverse... each node as two children. p0 | p1 / \ p2 / \/ \ { ... } The above tre...
[2 replies] Last: yes i think it will. thanks alot. i hadn't thought about it like th... (by Alan)
Calling an overloaded virtual member of a base class
 
struct Base1 { virtual void Foo( void ) { std::cout << "Base1::Foo( void )\n"; } virtual void Foo( int i ) { st...
[5 replies] Last: Thank you for the responses. This was exactly what I was looking for. ... (by EnderJSC)
Looking for something to record a key press.
 
Alright so I know a lot of these functions. But I can't find the correct one for the purpose I want. I want to be able to record the key presses on my computer ...
[2 replies] Last: Awesome, found what I needed. Thanks ;) (by Mythios)
Method declaration and const
 
Hi everybody, I am new here. Nice to join our forum. I have a question: virtual void solve() const { } What does this method do with const? Thanks you in...
[2 replies] Last: It means that it doesn't modify the object from which is called ( so y... (by Bazzy)
include problem
 
hi all, i have 3 files: classes.h (just class declerations), classes.cpp(function definitions of the classes in classes.h) and main.cpp... classes.cpp includ...
[8 replies] Last: thanx all :) (by mehmedean)
Christmas Prank
 
I'm trying to make a christmas prank program (fake virus); and this is how it works: 1) Opens up itself in another command window 2) Runs a bunch of complic...
[3 replies] Last: Uh... That's a command line script. There's nothing to compile. (by helios)
by Minkai
recall constructor?
 
I would like to know whether is it possible to recall the constructor of an object. So say I created an object and change its data whatsoever, and then I want t...
[1 reply] : No, as far as I know. You could however do sometihing like class MyC... (by hamsterman)
by aash
c or c++
 
what does this statement means? std::cout<<std:: something like that....... is it in c or c++?
[5 replies] Last: Check out http://www.sgi.com/tech/stl/ (by jsmith)
problem
 
Problem: A vector of integers is given. Program should Reduce the vector of integers by cumulatively applying a function to every two digits, starting from the ...
[4 replies] Last: Thank you! (by n4nature)
passing objects from for_each() to calling function
 
I want to insert each element in a vector into a hash table. I am doing that by for_each in <algorithm> header file, which calls insert() function, which insert...
[11 replies] Last: Thanks!! (by n4nature)
Why I can't use min() or max() ?
 
#include <iostream> #include <algorithm> using namespace std; int main () { cout << "min(1,2)==" << min(1,2) << endl; cout << "min(2,1)==" << min(2...
[2 replies] Last: Wow~ reply so soon... Thanks :) (by Robertsong)
multifile projects; Visual Studio; multiple errors
 
I have done a little C++ now (previous java, c#) so far I have just made single file programs (short algo's mainly) and compiled them with G++. now I am ussi...
[5 replies] Last: Er It made sense in my head when I said it, but I can't find the lo... (by Disch)
by prokek
Simple C++ Program (1,2,3,4,5)
 
Hi, I'm trying to write a console program that will sort and find the median of numbers that are given in a text file. The text file can have ints or doubles. ...
[81 replies] Last: good job denis. I dont think he was supposed to use the algorthm stuff... (by btripp)
What's wrong in this code? (1,2)
 
Hello everybody I was just surfing the net for interview questions and i get one expression in C++ It says so long value; //some stuff value &= 0xFFF...
[20 replies] Last: This makes me worry about my first interview (if I ever get one). Will... (by closed account S6k9GNh0)
Stats Program
 
Hello everyone! I am currently working on a World Series Statistics Program for my Comp Science Class at school. I have a problem with my program though. The ca...
[no replies]
December 2009 Pages: 1... 34567... 16
  Archived months: [nov2009] [jan2010]

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