data corruption on pointer cast


llo, Names matt, I implemented a set class as follows: template class Element { public: virtual int operator == (T) = 0; virtual int hash() = 0; }; /** * A efficient hash implementation of a Queue-set that does ...
Posted On: Monday 26th of November 2012 12:07:53 AM Total Views:  84
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




initialization of static data members in template class

I'm trying to use a template class containing a static data member, but I'm having trouble with the definition/initializations of these static data members. In particular, consider the following test code (heavily abstracted from my actual production code): #include ...
VIEWS ON THIS POST

129

Posted on:

Saturday 24th November 2012
View Replies!

Reading binay data

I have some binary data with a 2 byte word described as follows: LSB 08 09 10 11 12 13 14 00 MSB LSB 00 01 02 03 04 05 06 07 MSB I know this is supposed to ...
VIEWS ON THIS POST

46

Posted on:

Sunday 25th November 2012
View Replies!

Does lex+yacc produce a tree data structure that is easy for anexternal C++ program to examine and manipulate?

If the goal is to take a 1-dimensional package of text and produce a tree data structure that is easy to understand and manipulate, and then write C/C++ code that works with that tree - does lex/yacc suit that purpose ...
VIEWS ON THIS POST

188

Posted on:

Sunday 25th November 2012
View Replies!

possible to capture command line application data normally sent toconsole

Hi. Is is possible (I am using cbuilder 6, though sometimes the free turbo and sometimes the old borland 5.02) to activate a command line program (I am referring to osql) from within a c++ application, and get the return ...
VIEWS ON THIS POST

209

Posted on:

Sunday 25th November 2012
View Replies!

Need help Wave data mix

, I need mix two wave data to one. I add two data using float, but I got the error message" Invalid floating point operation" My code like this What's wrong while(SoundStream2->Position < SoundStream2->Size) { SoundStream1->Read(&fData1, sizeof(float)); SoundStream2->Read(&fData2, sizeof(float)); ...
VIEWS ON THIS POST

82

Posted on:

Sunday 25th November 2012
View Replies!

copy data on screen

i have small gaem which pick a word randomly from a list of 100 four letterd words and asks user to guess it, when user inputs it, program compares the inputted word with the randomly picked word and return results, ...
VIEWS ON THIS POST

64

Posted on:

Sunday 25th November 2012
View Replies!

initialize constant data members

How to initialize constant data members in a class \t...
VIEWS ON THIS POST

59

Posted on:

Sunday 25th November 2012
View Replies!

Q) Identifying the correct data type at run time (RTTI anddynamic_cast)

I ran a small experiment involving RTTI and dynamic casting. Basically what I did was to cast a base class pointer to a derived type (yes, I know that is not kosher). I then performed dynamic_casting and I invoked RTTI. ...
VIEWS ON THIS POST

70

Posted on:

Sunday 25th November 2012
View Replies!

how to achieve thread safety at element level in STL data structureslike hash map, vectors

Our application uses the caching heavily to store the data from databases & also the runtime orders information. these caches are built on STL hash map, vectors & maps and data format is the structures. There are multiple threads ...
VIEWS ON THIS POST

139

Posted on:

Sunday 25th November 2012
View Replies!

HOWTO: Get Warning on implicit type casts that may lead to data loss

, I'm migrating a C++ program from 32-bit systems to 64-bit systems. The old programmers used some annoying assignments like assigning "long" to "int", which may lead to data loss. Is it possible to let the compiler (specifically, GCC) ...
VIEWS ON THIS POST

53

Posted on:

Sunday 25th November 2012
View Replies!

how to save C++ builder form data in Run Time

Hi , I just changed from VC++ to Borland C++; I am facing a interesting problem: I would like to save run time user data in a form of Borland C++ form, by example: User selected an option from TCombox, ...
VIEWS ON THIS POST

77

Posted on:

Sunday 25th November 2012
View Replies!

Observer Pattern - Events containing different data

The observer pattern itself is easy enough. I've implemented it using a Event that contains data for any Event type I forsee my application using. My problem is I don't want one and only one general purpose type of Event. ...
VIEWS ON THIS POST

70

Posted on:

Sunday 25th November 2012
View Replies!

question on static member data

consider the following program: class Test { public: static Test i; static double d; int x; }; Test t; int main() { return 0; } This program compiles fine with both g++ and VC++ 2005 Express Edition. Since I have ...
VIEWS ON THIS POST

62

Posted on:

Sunday 25th November 2012
View Replies!

Clearing the data in a std::ostringstream

Is there any valid way to clear the data from a std: stringstream so that the stream is positioned at the beginning and is empty -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do ...
VIEWS ON THIS POST

69

Posted on:

Sunday 25th November 2012
View Replies!

why static data cannot be accessed from other programs file

Hi Folks, Just wanted to know few things about static variables. why static variables cannot be accessed in other files by using extern in c/c++ whats the difference between global and static variables Both these variables behave almost in similar ...
VIEWS ON THIS POST

148

Posted on:

Sunday 25th November 2012
View Replies!

Template-based database library?

Database-related libraries are conspicuously absent from Boost. Does anyone know of a template-based, open source, relational database library that supports the representation of arbitrary relations with compile-time type safety Or has such an achievement been found to be impossible I ...
VIEWS ON THIS POST

47

Posted on:

Sunday 25th November 2012
View Replies!

const data in descendant classes

, I would like to be able to store some constant data that is specific to each descendant class. This data would then be accessable by base class functions. However, I cannot find out how to do this. I thought ...
VIEWS ON THIS POST

108

Posted on:

Sunday 25th November 2012
View Replies!

regarding sizeof operator for class with no data variables

consider this code snippet #include using namespace std; class A { void func() { } void func1() { } void func2() { } void func3() { } }; int main() { cout<
VIEWS ON THIS POST

202

Posted on:

Sunday 25th November 2012
View Replies!

regarding sizeof operator for class with no data variables

consider this code snippet #include using namespace std; class { void func() { };...
VIEWS ON THIS POST

188

Posted on:

Sunday 25th November 2012
View Replies!

Creating array of data types

Hi , I would like you help me in creating an array of data types. I am interested in look at the the data type which looks like this Array a[10]={int,float,char,int*..............................}, so that a[0] should return me int and a[1] ...
VIEWS ON THIS POST

116

Posted on:

Monday 26th November 2012
View Replies!