General C++ Programming - August 2010 (Page 18)

qn on method pointers
 
so I want to create a class with a utilty method that takes as a parameter a pointer to another method in the same class. How do I go about 1) declaring sai...
[4 replies] Last: many thanks for the help, oh one more thing, if the method is a const ... (by unregistered)
File output skips first line
 
I am learning C++ and have come across something that is confusing me. My goal is to read in a file, add some things to it, take some input then output all of ...
[7 replies] Last: Found the problem, was before the for loop. I changed this: ofst... (by zltippett)
reading binary file with header
 
hi, im trying to read a binary file with header. so i manage to read the header by calling this: fread(&headers, sizeof(MtexHeader), 1, fp); the he...
[1 reply] : You need to give more information. Like, much more. (by Athar)
g++ 2.3 & g++4.2
 
Hi, this code was running fine on g++2.3 but getting template mismatch id error on g++ 4.2. could anyone point out me reason. using namespace std; templ...
[8 replies] Last: ya it is typo mistake (by agoswami)
code size within a function
 
Hello All, Is there any standard or specification which says that lines of code within a function should not exceed some number (ex: not more than 100 or 60 ...
[3 replies] Last: Thank you Mr.Bazzy and Mr.jsmith for replies (by nkumar85)
by declan
Odd error: "invalid controlling predicate" whilst using OpenMP
 
Hey guys. I'm using g++-4.2 on a Mac (not my choice, I hope steve jobs dies in a fire). I compile some pretty simple code: using namespace std; #inclu...
[5 replies] Last: ah, right, I mixed that up with the power function, my bad. (by Phantom139)
function pointers defined outside a class to point to a member function
 
I got a OPC client DLL, which connect to OPC servers, I use functions from the OPC client DLL via a header. This is the typedef for the function pointers in t...
[no replies]
[template] Why this doesn't compile ?
 
Hello, I'm not sure why this code doesn't compile. If someone can explain, or point me to the standard where it is explained, it will be greatly appreciated....
[3 replies] Last: The correct syntax is: struct Bar { template<typename U> stat... (by Bazzy)
by onur
Volatile list iterators
 
Hi, I'm trying to get my volatile list iterator working, but I'm not able to assign it to another list iterator. Here's my code class MyClass { ...
[6 replies] Last: What I tried to avoid was using a mutex etc. I wanted to declare th... (by onur)
by bm2010
save/load struct array to/from file
 
im looking to save a struct array to a file. im trying to get it to save the data, but since its a multi-dinmensional array it doesnt seem to work, but it does ...
[2 replies] Last: alrighty, thanks. that will have to do then, but hey if it works, it w... (by bm2010)
by piotr5
polymorphism and operator==
 
suppose I have a class containing vector<Shape*> m_allShapes; and Shape is the base-class for various shapes like "Circle" or "Square" and so on. how shou...
[2 replies] Last: thanks. at least now I know how the majority handles this. (by piotr5)
Python SWIG: How to interface a List of objects
 
Does anybody use SWIG here? I have written an interface file, and it works well for normal variables, stl vectors. Without doing any typemapping it work...
[no replies]
C++ Prime Numbers
 
How this code actually works int i, j; for(i=2; i<16; i++) { for(j=2; j<=(i/j); j++) //confused if(!(i%j)) break ; if(j>(i/j)) cout<<i<<" / "...
[4 replies] Last: Example; 25%12 returns the remainder of 25/12, wich is 1 So with i... (by Skillless)
Library system through filling
 
Hello Everyone... I have been trying to do my summer project and have encountered a problem. I am going to paste my code in here and looking for some help. ...
[no replies]
Map change access via iterator
 
Hi All, A quick question. I'm trying to find how to alter a map container via a iterator. This was posed as a test question in a book. To pass an output ite...
[2 replies] Last: Thanks for the swift reply. Having the key non changeable makes tot... (by acerjacks)
Trying to get my slots to work
 
I am trying to get this slot machine program to work. I have most of it and am ready to rip my hair out. Can someone help me find where I am going wrong please....
[3 replies] Last: Here are the two errors i am getting. Now I know it has to be somethin... (by iamtito)
recursive sorted merge sort linked list
 
I'm having trouble getting the functionality here if anyone can help. Basically I'm needing to pass in 3 head pointers to 3 different linked lists. I need to pu...
[1 reply] : //else if(xHead != 0 || yHead != 0) else if(xHead != NULL && yHead... (by ne555)
by khatat
global object or ... ?
 
Hi I'm learning c++ in linux but already I've worked with Visual Basic and now I have a problem in C++: I have two classes in two separated files (mainwindow....
[no replies]
by Wander
SDL Not Responding
 
OKAY!! I haven't used SDL in a while and I decided to whip up a small, simple program to make sure it's still working. Whenever I run the program it works fine ...
[6 replies] Last: If you want the program to be constantly active, then you don't use SD... (by Disch)
Template issue
 
Hi, i've got a little problem with templates. I got many errors when i try to compile this peace of code: template <class T> class CNumber { public: CNum...
[5 replies] Last: //Edit I got this. I add: template <class TT> before friendsh... (by mtweeman)
August 2010 Pages: 1... 1617181920
  Archived months: [jul2010] [sep2010]

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