General C++ Programming - March 2009 (Page 15)

Suggestions?
 
I just finished a rough draft of my tetris clone. Could anyone give me some feedback? Thanks! http://web.ics.purdue.edu/~cjreilly/Blocks/
[1 reply] : PROTIP: When posting a complete program in a programming forum, don't ... (by helios)
Question about inheritance
 
I have a base class called Node. Inside the class I have a data member that is a vector to keep track of children. I want to make a derived class called LeafNod...
[3 replies] Last: Errr.... It does inherit private stuff. It just can't access it.... (by Disch)
Preprocessor Directives
 
A buddy and I are working with SDL on a game. Unfortunately, he is confined to Windows at the moment, while I develop in Linux (SDL is cross platform). The pr...
[4 replies] Last: Thanks everyone! That solved the issue. (by scottwuzhear)
string inside Union
 
Hi Guys, Can't we have string inside unions? When I try to use class A { public: string str; }; union { A obj; }p; It keep saying t...
[7 replies] Last: i think no class object will go inside a union because even if you ... (by kevinchkin)
Visual Basic 2008 difference calculating
 
How do I make a a program in vb 2008 calculate the difference between the first thing, and then the last thing entered? For example, I tabulate the amount of...
[1 reply] : You might have better luck asking this question on a Visual Basic fo... (by Disch)
by sable0
Wrong output - Any ideas?
 
sdfsdfsdaf
[1 reply] : You never call the getvalues() function for your AreaVolume1 object. ... (by cjr9968)
File I/O
 
Hello Everyone I've been struggling to figure out what I'm sure is a simple problem. Say for example I'm creating a file that lists a description of a person...
[3 replies] Last: You can ignore all the data before the newline character eg: you... (by Bazzy)
socket programming
 
Greetings, I am a beginner in socket programming and have been trying to set up a c server that accepts connection from a php page. The problem is that i am un...
[3 replies] Last: Douglas Comer's example can be found here: http://rtes.cn.nctu.edu.tw/... (by kbw)
revision control system(code management)
 
hi all, i need some help from you. I would like to know if there is any revision control system in visual studio. if yes how to use it. if not how can use one ...
[2 replies] Last: thanks man for your help i m googling vss right away (by tukuniata)
Weird Problem
 
Hi Guys, Code Snippet 1 with malloc using namespace std; struct Et { int i; string s; }; int main() { Et o; char da ; memset(da, NULL...
[5 replies] Last: The difference between malloc and new for C++ objects is that new, asi... (by jsmith)
Retrieving data from a file
 
I am new to fstream, and I need help ASAP! My goal is to make a program that opens a .dat file and it checks to see if the number exists in the file. If it d...
[4 replies] Last: the full working program is this: #include <cstdlib> #include <... (by writetonsharma)
STL vector, STL list, new, delete question
 
Hello! I have two for loops below. The first for loop puts node objects into a vector. The second for loop uses the delete operator to free memory creat...
[2 replies] Last: Cool! Thanks! (by translore)
Linked list and file I/O
 
code begins here -------------------------------------------------------------------- struct Bartender { char ID ; char name ; }; struct Nod...
[2 replies] Last: Thanks for replying, computereuip. I got them cleaned up. I had no ide... (by wonkdance)
modifying main() to enable interactive data entry
 
Hi I am a little stuck with a fraction program where currently it uses simple but inflexible literal values to show the adding of a fraction, It has three fi...
[2 replies] Last: Thanks, your reply came too late however, I figured it out in the end. (by rushhour)
Optimisation question
 
In my code, I have to access variables in a struct about 1000 times. I was wondering whether it is faster to copy the struct to a local variable first. For e...
[4 replies] Last: But I always thought a.b is faster than a->b, because a->b requires t... (by Disch)
Pass by reference differentiation problem
 
My task is to write a program with a sub function that will differentiate a polynomial when the user enters 6 integers. Also it should return true if the the re...
[3 replies] Last: Btw: You can still "optimize" the code: a *= 5; // instead of a = ... (by onur)
by lidong
HOW TO CALL PRINTER TO PRINT SOME TEXT IN C++
 
HI!..Im planning to make a program that print a reciept but i dont know how to call the printer to able to print what i want to print..any idea or comment? ...
[1 reply] : It's very easy inside of the .NET framework. Other than that, I don't ... (by closed account S6k9GNh0)
val % size >= size?!
 
I have this short question: under what obscure circumstances can this happen?
[6 replies] Last: val is unsigned. unsigneds can never be negative. Lines 10 and 11 ca... (by jsmith)
by simov
STL vector Problem: push_back derived object but get base object
 
Hello, I have a problem about STL vector. I expect vector can hold my derived objects. But it doesn't. My program is like this: ===============================...
[6 replies] Last: Of course it won't. The declaration vector<CBase> allocates memory ... (by jsmith)
Pass by Reference (1,2)
 
Hi, I am asked to pass by reference to this method, but seem to be meeting with some errors. If i remove "&" from int solve(P &p) it would work, but i nee...
[23 replies] Last: Thanks Aakanaar and jsmith for the explanation. So actually if i di... (by shaoen01)
March 2009 Pages: 1... 1314151617... 21
  Archived months: [feb2009] [apr2009]

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