General C++ Programming - October 2008 (Page 3)

Classes, Pointers, and Functions
 
Ok, lets say I have a generic function like this: void send_name(animate* Animate) { cout<<Animate->getname(); } And I have classes like this: ...
[2 replies] Last: Yes, but this is just an example of how the problem comes up, it's tha... (by firedraco)
by jithin
Segmentation fault ...while accessing the struct member of type vector
 
//defining structure typedef struct config_files { string A; string B; string C; vector<string>files; config_fi...
[1 reply] : Try clearing the vector...it should be cleared by default, but... (by firedraco)
random organized array
 
Hi all, I have a problem and I hope there is an easy solution for that. I have a linear array of size N, the array just contains a zero or the number of t...
[2 replies] Last: See also random_shuffle(). (by jsmith)
im having a problem this is my first time using structs .. i think its in main
 
#include <iostream> #include <iomanip> #include<fstream> using namespace std; const int size=20; struct studentType { string firstname; ...
[1 reply] : infile>>firstname.myStudents >>lastname.myStudents >>testscore.myStud... (by Smok006)
LNK2019 and LNK1120 errors
 
Naturally, I searched for solutions about these errors, but it doesn't seem to corrolate with mine. I've been trying to get this dynamic array/vector program to...
[1 reply] : Found a few things wrong. 1. The problem with the friend function w... (by guestgulkan)
Regarding Eof function
 
I would be glad if someone can help me out... In our class teacher told us to check for eof using 'if condition only' and not to use 'while'..Its all totally...
[3 replies] Last: Thanks...I understand it now. Our textbook is very confusing....Now it... (by vin1391)
CSV in array
 
I want to read from a stream and put the data in an (2D)array. The file I'm reading is a CSV-file like the following: 0.1;12345;98 0.2;5006;52 0.3;4540;38 S...
[6 replies] Last: Thanks for the code, trying to work it out.. (by rkoster)
by shox
Huffman problem -> Floating Point Exception
 
Hello, I'm working on a Huffman Coding program and I'm having some trouble with my decompression. I'm getting a Floating Point Exception error when I try to de...
[2 replies] Last: I get this from the debugger: Building to ensure sources are up-... (by shox)
How to prove the ff program?
 
How to prove the following program if it is correct... using some kind of BNF solving... Please need help!! problem program: {n>0} count = n; sum > ...
[4 replies] Last: what about the "typedef"? which statements to be replace?? (by dualshock03)
HEAP error
 
I have no idea what is going on here. I use the following code. It is called. Everything is fine. void Camera::setPositioning(D3DXVECTOR3 setPosition, ...
[10 replies] Last: From the code you have specified I cannot see any cause of your heap e... (by Zaita)
Asio: Synchronous? Asynchronous?
 
Hi, first time poster here. I've been trying to work my way through some Boost::Asio tutorials, and one thing just hasn't been explained at all. What is the...
[4 replies] Last: On top of it (as above said) Synchronous blocks the process until the... (by satm2008)
Look at my Local Port Scanner - Need to Be Fixed Little Bit!
 
First of all, i want to say Hi! Glad to join your great forum & glad to part of your members team! The following program scans range of port of the local mac...
[9 replies] Last: Just a note. It looks as though you are actually making a connection ... (by Zaita)
passing istream reference to derived funtion
 
Are there any restrictions on passing an istream reference to a derived function? Is there any way to make this work? I've written a class with a derived su...
[1 reply] : More information: The problem seems to actually occur during the ca... (by digiplant)
How to get string from a file terminating with another string
 
I want to get a string from file terminating with another string. As We have data file data.txt and the text in it is - kkasdasjdnajsdnjasdasd#kjlkldasfkl...
[8 replies] Last: Hey aakashjohari, You're on a forum belonging to one of the best C+... (by danthehat)
Listing a Directory
 
I want to do is following Listing the file in the directory and save all relevent information to array or vector or something else Originally, i am using ...
[4 replies] Last: while (pent = readdir (pdir)) // while there is still something in ... (by guestgulkan)
Language gurus: Is this a valid structure?
 
typedef union { uint16_t gray; uint16_t rgb[ 3 ]; struct { uint16_t red, green, blue; } uint8_t alpha; } tRNS_t; I ask just because...
[2 replies] Last: Thanks for the response. That is basically what I was wondering. I onl... (by Duthomhas)
how to remove an integer from a array
 
so i have this program and in my removeAt function i need a new way to remove an integer out of the array this way works i jus need another way to do it pleas...
[11 replies] Last: I would study my code until you understand it. Copy+Paste is only goin... (by Zaita)
Creating an Array of pointers
 
Say if I wanted to make an array point to an array of pointers.. lets call the type TypeOfObject* so we have TypeOfObject** arrayOfPointers = NULL;...
[2 replies] Last: I think this is what he means: TypeOfObject** arrayOfPointers = NU... (by cjmalloy)
How to create a new object
 
I just learned about objects. But I still dont know how to create a new one within the program. For example: I am writing a Harvest Moon type farming sim. I...
[3 replies] Last: great, thank you smok006 and jlamothe. (by Cerburos)
Reading Lines from Text File
 
I have searched many a site to find an answer to this question, so here goes: (This is actually C, not C++ so bear with me) I'm doing a hangman program that...
[6 replies] Last: I saw that example before, but my question with that is, where do i sp... (by madd0g17)
October 2008 Pages: 12345... 11
  Archived months: [sep2008] [nov2008]

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