General C++ Programming - December 2010 (Page 21)

polymorphism different methods
 
I have a database of Users (Customers and Admins) with different tasks. I want to solve this with polymorphism: class User { protected: string user...
[3 replies] Last: This will work but you'll have to write a constructor for the Admin cl... (by slicedpan)
how define a function that return an array
 
hello . how can i define a that it return an array; type fname(){ type array ={0}; ... ... ... return array; } please guide me with a good code...
[2 replies] Last: The problem with an array is that you must also know the size of the... (by Duthomhas)
String manuplation accesing a sub string
 
hello frenz, i am having a small problem i am not able to figure out how to remove first 6 bytes from a QByteArray and append the next 40 bytes into another byt...
[3 replies] Last: hello frenz i solved my problem. This is what i did. :) for(int i=0; ... (by crazycoders)
howto use mingw graphical library
 
how can i use mingw graphical libraries like png.h and etc. please reply me by code.or introduce me a good refernce about this topic.
[1 reply] : I'm not aware of any "mingw graphical libraries". If you want to use l... (by Athar)
3-d array using alloc
 
I have written a subroutine that will create a 2-d array using alloc below: using namespace std; double** calloc_2d(long int l,long int m) //allocate a d...
[2 replies] Last: You might want to try a more manageable way to store a multi-dimension... (by PiMaster)
copy and paste text, cross-platform
 
hello, can you help with two functions, void copy (char * c), char * paste (); to copy and paste text from the clipboard, not for an OS in specific, but for all...
[no replies]
Linked List = overload problem
 
I am trying to do an operator = overload for a linked list. I keep getting a a thrown exception from my isempty() function called from my atTop() called from ma...
[1 reply] : In your overloaded operator =, you make pointers to 2 stackNodes, but ... (by quirkyusername)
by RMA
faster "Class" code
 
class Mesh { public: Mesh(PolygonClass& a_PolygonClass) { PolygonList.push_back(a_PolygonClass); } } Is this better/faster to have the constructor...
[1 reply] : It can be faster when it is in the header, because it becomes eligib... (by Athar)
Changing array of Objects to Pointer Of objects.
 
Hi Team, I have written this small program: //============================================================================ // Name : ReadingTxt...
[4 replies] Last: Hi Team, Actually this approach will give me rid of this variable M... (by DOORS84)
by wtf
Ok how about this?
 
#include <iostream> #include <limits> using namespace std; int main(), cinsize(istream & is); int main() { cout << "This is a test.\n"; ...
[6 replies] Last: I haven't read your previous threads and probably will not have time... (by jimc)
Vector inside a vector
 
Is is possible to have a vector inside a vector? If so could I see an example? Lets say you have Vector A and Vector B. Vector B is inside Vector A. How could ...
[3 replies] Last: I have to find to put seventeen vector in one with simple code. then p... (by appleguy)
Partial Specialization of Templates
 
Good Evening, Just a quick question if I may as I have trawled the web to no avail... When I create a partial specialization of a templated class, do I ne...
[2 replies] Last: If you only want to change the behavior of some functions when T is a... (by m4ster r0shi)
by kuuku
Need short C++ I/O Routine
 
Dear Forum: I am trying to write a C++ I/O routine for reading the material below. The code should ignore the comment; i.e. anything including and to the right...
[6 replies] Last: If at all your file is formated or you willing to format it. Please s... (by DOORS84)
A* G value
 
Okay, so i have followed a the pseudocode for an A* algorithm. But i still do not have a clear understanding of what the G value is. I have looked at 3 differen...
[5 replies] Last: g(n) represents the cost of the path from the starting point to any ve... (by Kyon)
Boost Serialization
 
Hi, am trying to serialize an std::vector but when i execute the program and try to add a user, i get a segfault on fedora whereas its working on windows. Than...
[no replies]
by toks
tutorial ?
 
Hello, I would like a good tutorial, book or/and website, on how to manage our comments on a program. Thank you .
[6 replies] Last: If your'e in a company, they probably already have standards for such ... (by Browni3141)
Hangman Can't Read next word from file
 
Hello All, I could use some serious help. I feel that I'm missing only a minor thing, but it's causing my program to not work correctly. I am a first year ...
[2 replies] Last: Shredded, You are the man(or woman)! I haven't tried it yet, but I... (by jgutowsk)
Remove elements from an array
 
I'm writing a brainf*ck interpreter (bored) in C and I've written myself into a corner. My main function branches off in one of two directions - interactive mod...
[3 replies] Last: @kbw, That's an excellent idea! @Disch, My main function was pass... (by chrisname)
Dynamic arrays in OOP aggregation
 
hello , i used an array using aggregration in OOP in order to insert multiple datatypes in the array and i wanted to convert it into dynamic array , so as to e...
[4 replies] Last: vector<player> players;// ; <-- get rid of that And your he... (by Disch)
by mppk
load a file specified by the user and turn it into a string that can used later
 
the program dosnt return with the txt when i insert the filename into it #include <string> #include <fstream> #include <iostream> #include <tchar.h> ...
[3 replies] Last: whenever i run the file What do you mean? Compile? cout << loadf... (by coder777)
December 2010 Pages: 1... 192021222324
  Archived months: [nov2010] [jan2011]

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