General C++ Programming - August 2010 (Page 5)

by sisi
static_cast
 
Hi all, I have some question related to using static_cast. Suppose I have 2 classes base and derived and I want to cast base type to derived. Of course I c...
[5 replies] Last: Thank you guys very much!!! (by sisi)
pointers to functions
 
Hi, I've been looking into pointers to functions and have made an example program which implements a pointer to a function passed into another function as a ...
[5 replies] Last: for your func, the compiler would understand return *func(a,b) as "c... (by bartoli)
read a text file problem
 
Dear friend I want read a text file in c++ and than I want write to this file on the screan but I make some mistakes please help me.. This is text files conten...
[5 replies] Last: Just to add to what Galik said, you also don't need to call close(), y... (by filipe)
Getting a IP Address
 
Hi all Im getting an error when compiling my project that gets the IP address of a host. Please see if you can spot the issue? Code: #include "stdafx.h...
[4 replies] Last: Works. Thanks! (by closed account Gy7oizwU)
by jhapk
Checking if a function exists
 
Hi, I am using a templated group code. In my particular class specialization, I define a function FunctionA in a particular templated class ClassA. For some ...
[1 reply] : See http://old.nabble.com/compile-time-check-that-a-member-function-ex... (by jsmith)
classes for chess game
 
Hi to everybody; I've written my own chess game using classes, and I'd like to discuss with you the choices I've made, cause I'm sure something can be improved;...
[2 replies] Last: It is standard chess, I made the board 12x12 and marked the external b... (by Clausius)
by effizy
Calculating Average score of uncertain students no - Newbie to C++!
 
Hello all, I am completely new to c++ and have no idea what am doing or should be doing but am ready to learn. My first problem is to write a code "to calcul...
[1 reply] : First of all you try to do something with numTimesNeeded.. i dont know... (by Skillless)
by pizet
Ordinal value
 
I tried to make a program for counting "big number". For example numbers which contain like 50 or 100 digits. I decided to put those numbers in strings and use ...
[4 replies] Last: Yup, thanks. (by pizet)
sleep() inside a loop.
 
I have defined sleep() in my program. I am using it in a loop. But I observed that sleep() is adding up the total amount of delay (no of times loop executes) an...
[4 replies] Last: @jsmith... hey thanks its wrking now. :-) Ill read more on stdout buff... (by vicky1711)
"C++" classes in "C" code
 
Hi, I have two C++ files (classes are defined in that with member functions).I want to use them in "C" files. Do I need to write compatible wrapper functi...
[4 replies] Last: Hi Helios, We have a big code that is written in C, and some code i... (by Priyanshu)
error: array bound is not a constant
 
I have the following situation project01.cpp: #include <iostream> #include <fstream> #include <string> using namespace std; extern const int MAXR...
[4 replies] Last: "What you need to do is REMOVE project.cpp from being a separately com... (by officialhopsof)
new to building finite-state machines. Where do I begin?
 
Hi, I have been reading the tutorials and it shows how easy C++ really is. What I still haven't reached yet is how to make finite-state machines. I doubt that ...
[1 reply] : FSMs lend themselves very nicely to implementation in C++. If you und... (by AbstractionAnon)
Derived class and destructor problem
 
Dear forum, I have a problem concerning derived classes and their destructors. I have a base class Shape and I have Spheres, Planes and ObjFiles (shapes from...
[17 replies] Last: You must have some other problem elsewhere. There's no reason I can s... (by Disch)
Another .csv question
 
I want to read a .csv file with two columns into two variables. The variables will then be used a couple of calculations, after which a value will be writen int...
[2 replies] Last: Thanks Galik, I'll give it a go. (by Gert1234)
by eye51
Is default constructor always required ??
 
Hi, Should I define default constructors every time even if my used constuctor is always with arguments? Any problems if I do not define it? Thanks... ...
[9 replies] Last: I want to change MyClass properties through YourClass As I have c... (by EverBeginner)
sum up 2 inputs,the sum is added to the next num of the 2nd input and so on
 
hello..its my first time here.. i need help regarding an assignment..any help with do pls..i understand the flow but don't quite know how to start.. the fir...
[3 replies] Last: change int* iInputs = new int ; to int* iInputs = new int ; ... (by Skillless)
how to use getc (or someting similar) outside of a console
 
i am trying to broaden my horizons of programming, and attempting to make more cross-platform friendly programs. instead of using a direct x wrapper, openGL, in...
[2 replies] Last: do i really have to use an API for keyboard input? Yes. That ... (by Disch)
by nocare
Trouble returning pointer of array
 
Hey all, this is my first post, but this site contributed to me learning c++ 4 years ago, and now that im getting into it again... having advanced in programmin...
[11 replies] Last: Yeah I finally feel like I have a good grasp on the arrays. I do li... (by nocare)
Substript Problem
 
Dear Forum, I would like to declare The Array of the size enough to accomodate data as long as the application setup follows till the order requirement. Th...
[2 replies] Last: I think the second one is more effective, because instead of typing ... (by Skillless)
a tree
 
I have a tree that looks like this: struct NODE{ vector<NODE*> children; }; I want to randomly choose one node with equal probability to choose the ro...
[2 replies] Last: thanks. didn't think about that.. (by hamsterman)
August 2010 Pages: 1... 34567... 20
  Archived months: [jul2010] [sep2010]

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