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

fread error (reading a random access file sequentially)
 
Please assist guys i've been killing myself over it for days trying to figure it out on my own and now the final due date is later on today /* Peter Mo...
[2 replies] Last: Thank you so much, i figured it out at school today! xD But i didnt k... (by powercut)
_BLOCK_TYPE_IS_VALID(phead->nBlockUse) — assertion faliure
 
Please help me. When the deconstructor is called and the line if(m_director != NULL) delete m_director; is executed I get error that says :"_BLOCK_TYPE_IS_V...
[3 replies] Last: http://en.wikipedia.org/wiki/Segmentation_fault Both allocate memor... (by helios)
by vRltwE
Passing a matrix from one methot to another
 
Hi, I call a method matrix = matrix_read(iFile, lines, cols); that will return a matrix. There is a problem in the way I am making this call. Netbeans o...
[3 replies] Last: Hi, how can I do to pass matrix from method matrix_read to mai... (by vRltwE)
problem with some data structures
 
Hi at all... I'm develop an application in c++, for the simulaiton of some particles. my problems is this: 1 - I created a data structure called grid (Insid...
[4 replies] Last: #include "GridLayer.h" #include "Particle.h" #include <vector> ... (by ulisseodisseo)
EOF= -1 ???
 
I have a simple code to get interger from a file.. but have problem int main() { FILE* f; f=fopen("test.txt","r"); int number; do { fscanf(f,"%d",&numb...
[3 replies] Last: oh and in your code you were reading formated text, the same as you wo... (by csiz)
Pointers, global variables, and class frustration...
 
I'm to create an application that reads words from a given input file. The application counts the words in the file, then reads them and stores them in Word obj...
[1 reply] : if your working with classes , that means c++, why don't u use stl , e... (by csiz)
by nikers
Trouble with classes communicating...
 
All, Sorry if there is another thread regarding this, but I did not see one... I am using VisualStudio 2008 to write my C++ programs for school. We are w...
[no replies]
Arrays, Pointer Arithmetics and Type Casting
 
I have a function that takes two pointers as parameters, each points to a beginning of an array. The two arrays are of two different classes. The items of the f...
[3 replies] Last: Problem solved: this method doesn't work unless the classes have the s... (by Tom Backton)
by csiz
unexpected class/pointer behavior
 
After a few hours of questioning myself why my button doesn't work in one case but works in another , using the same function I simplified the problem to someth...
[2 replies] Last: Dam that was a huge pain in the darkness to fix. I made them virtua... (by csiz)
Generating randomized values within a given range with no redundancy.
 
I'm working on a project right now which processes a lot of data. The gist of it is that you give it a string of hashed text, and it generates random text whi...
[17 replies] Last: ok... now something offtopic: may u make a squirrl fly to sirius by... (by Incubbus)
How do I write a binary integer to a file, using a string?
 
I'm writing a program to read information of a proprietary file format. The format is as follows: _ The file holds conversation dialogs. So, the main info are ...
[1 reply] : string.push_back(n&0xFF); n>>=8; Iterate that to write the integer... (by helios)
I dont know how to use a for loop anymore?
 
I had this problem while programming physx, it must be something obvious since i am kind of new to c++. Hope the you guys can give me a light here This class...
[2 replies] Last: The for does what you'd expect it to, so that's not the problem. The p... (by helios)
coredump due to SIGBUS
 
Hi All, I'm getting the following coredump due to SIGBUS. But the stack trace shows the problem is in down_cast. Following are the pflags and stack traces ...
[9 replies] Last: Right -- well my suggestion to try catching std::bad_cast was silly. ... (by PanGalactic)
Processing input of a Char and an Int
 
I am writing a program and I have run into a snag when I'm trying to process the input. What I have is a program that processes a string of numbers that the use...
[1 reply] : Why not just disallow zero or for that matter any number less than and... (by buffbill)
My Huffman Solution! Critique My Code Please!
 
Alright so here is the problem: Exercise: Write a Huffman compressor and decompressor. Huffman is a compression algorithm. This particular algorithm is an en...
[7 replies] Last: Cool man...glad to hear you think it is neat so far! (by translore)
by kljuco
assertion problem (destructor)
 
hi i have problem with dealocating dynamic twodimensional array...i will paste code here and hope someone can help me...problem is in destructor of template cl...
[1 reply] : In function: void kolekcija<T>::addUKolekciju(T &a) { ptr =&a; ... (by kbw)
Troubles with members override rules
 
First of all, this is my first post here, hello there folks! I'm designing some simple bin_tree classes as exercise ( normal bin tree, red black bin tree ); ...
[8 replies] Last: The only-when-needed dynamic_cast<> solution proposed by Disch seems t... (by denis90)
No iostream
 
Is there a way to get something displayed on the terminal window without using iostream.h or any header file I cant include header files as I am trying to bui...
[9 replies] Last: The only thing you can do is try till ya die. I would suggest looking ... (by closed account S6k9GNh0)
expected initializer before '&' token error
 
I have made a header file as follows; class float16 { public: float mantissa; long double expo; float16 operator+(float16); float16 operator-...
[1 reply] : Are you missing using namespace std; ? (by kbw)
by Lana
A new-initializer error
 
During the compiling process with the compiler gcc 4.1.2 and have the following error message: " error: a new-initializer may not be specified for an array " ...
[2 replies] Last: You have to rely on the default constructor. The code becomes: Sort... (by kbw)
April 2009 Pages: 1... 34567... 20
  Archived months: [mar2009] [may2009]

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