General C++ Programming - January 2009

by Nobun
New/Delete with a Class that uses malloc (1,2)
 
I have a simple question. I need, for particular reason, to use malloc/realloc and free into a class in this way Class A { DATATYPE * pointer publ...
[21 replies] Last: Probably I got the name only from my confusion. Thank for explainatio... (by Nobun)
[SOLVED]problems with an array
 
Hi! I have some problems with a program that I tryed to make this morning.It has to make an array of up to 25 elements, show the elements on screen, write the e...
[3 replies] Last: thanks :) (by evanescence)
operators
 
I have read tutorials on C++ but nowhere does it explain the use of the new operator. I understand to create an instance of a class in C++ you just decl...
[2 replies] Last: http://www.cplusplus.com/doc/tutorial/dynamic.html new is used to a... (by helios)
Data Types
 
Hi all, I'm on Mac OS X using C++ to load a bitmap image for texturing in OpenGL, however the few tutorials i have, use WORD and DWORD data types in the BITM...
[6 replies] Last: Hey thanks both of you for your help. Much appreciated. (by Zee Bidds)
CLASS SONG ERROR
 
/**************** Program #1 class that models an electronic music track ****************/ //Song Class #ifndef SONG_CLASS #define SONG_CLASS usin...
[1 reply] : ofstream ofile("song.out"); ofile << song.title << endl; ofile <<... (by psault)
I cannot trace my pointer
 
hello, here is the same stuation that I lived with my project. I am sending a variable to my function, function is doing something with a temp variable and tha...
[2 replies] Last: thank you, it is working now. (by afraidofdark)
Assitance with Simple Link List
 
I am trying to create a program (very simple) to gather a users desired x points and y points, store them into a list, and out put them like (x,y). But, I ca...
[14 replies] Last: Thanks guestgulkan, I move to fast, one of m major flaws, and found th... (by William McHugh)
by chuiy
strange error when iterating through a data array
 
hey, I'm using Dev C++ and the end of the marking periods coming up at my school, so being the 13 year old beast I am I decided to write a program that average...
[3 replies] Last: Well your approach to header and variable inclusion is most novel and ... (by guestgulkan)
How do I emulate fsync with ofstream?
 
I'm porting a program that used stdio file facilities to use std::ofstream instead. The original program uses fsync to force a file's buffers out to the disk. T...
[4 replies] Last: Thanks for the link to the info on _commit. That's the equivalent of ... (by ejubenville)
Code has nothing I can find wrong, but still won't work.
 
I am writing a program that reads directory data from a file and it won't work but I can't figure out whats wrong with it. Any help? // start of code #i...
[2 replies] Last: Thanks, I never would have done that, I was under the impression that ... (by brentc628)
by jrohde
#pragma comment in Dev-Cpp
 
I've seen it used a billion times, but when I tried to use it in my Win32 Project in Dev-Cpp, I still get the "undefined reference to..." errors, just as if I h...
[1 reply] : #pragma directives depend on the compiler, #pragma comment() is fo... (by Bazzy)
Can't compile in Debug but can in Release!!!
 
I'm using VC++ 6.0 with SP5. I have a source file in my project that refuses to compile in debug mode but will readily compile in release mode. When I look at t...
[2 replies] Last: Change the compile options of your file to just run the pre-processeso... (by kbw)
CLASS: SONG
 
//Song Class #ifndef SONG_CLASS #define SONG_CLASS using namespace std; class Song { private: string title; //dynamic allocation string album; ...
[2 replies] Last: You've written the default constructor twice: Here: //Implement a c... (by guestgulkan)
What's the difference
 
I have seen this "style" of coding in many places and have yet figured out why someone would use one "style" versus the other. I the best of my knowledge they ...
[4 replies] Last: That explains a lot. Thanks (by catch patrick)
fastest way to XOR 2 arrays of boolean?
 
Hi, I have two arrays of booleans, both have the same known size. I would like to perform a XOR on the arrays and store the result in a third boolean array ...
[11 replies] Last: Assumption is the mother of all f*ck ups Haha that made me laugh ... (by Mythios)
Vector of Template
 
I'm trying to make a vector of template. However, I want to store the template with different data types. For instance: class A {}; template<dataType> class...
[2 replies] Last: But that doesn't solve the original problem. Once a B<T>* is casted t... (by jsmith)
by ishii
Please find out errors and correct the code please
 
HI I have written this code but there is errors in it and not going to be compiled please help me out after removing errors.. i need on urgent bases becoz i h...
[3 replies] Last: Additionally, you need to walk through this code very carefully and as... (by seymore15074)
default value for templates
 
Hi, I need to implement a method fun() inside a class classA. The method fun() should be capable of receiving at most 3 arguments with any data type. I was f...
[11 replies] Last: I'm not sure for the data types. Hence, the issue is still open with ... (by pchahar)
by guykun
Transparent TextBox
 
I've looked around the internet endlessly try to find a way of doing this in C++ and haven't been able to find a single working method. How would I go about ...
[3 replies] Last: Ask on Win32 ng news://comp.os.ms-windows.programmer.win32 for the ... (by george135)
How to iterate and print Boost Ublas' Vector
 
Hi, I tried to print Boost Ublas vector here. But somehow it gives error. What's the right way to do it? // Begin #include <boost/numeric/ublas/vecto...
[1 reply] : You forgot the comparison, v1.size() is always true. (by kbw)
January 2009 Pages: 123... 11
  Archived months: [dec2008] [feb2009]

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