General C++ Programming - August 2011 (Page 15)

expression must have a constant value - second subscript value in field
 
#define NULL 0 #include <iostream> using std::cin; using std::cout; using std::endl; int main() { int n, m; char *field(NULL); field = new int ...
[10 replies] Last: [quote=andywestken]vc2008 doesn't support C++0x, but gcc does (support... (by closed account zb0S216C)
Linked List search
 
I am trying to search my linked list that stores data about books. this data is held in a class called proceedingsBook. i am searching on there ISBN number. my ...
[2 replies] Last: ah yes, putting those brackets in made me realise i dont want to actua... (by hastingsdirect)
Can class B inherit a friend function from class A ?
 
Hi folks, Something is not clear to me with the following code : #include <iostream> using namespace std; void func(); class A { private: int z; publi...
[8 replies] Last: I got it , you can access the inherited fields that B got from A , but... (by david112)
Favorite part of C/C++
 
I was just wondering what your favorite aspects of C or C++ are?
[14 replies] Last: I know this sounds silly but I like functions even though functions ex... (by TheMassiveChipmunk)
reference return type
 
I have this function in a class std::vector<RECT>& snake::snake_getsegs() {return _segments;} It is used as a parameter to this function _LVL->level_sh...
[11 replies] Last: well I am glad you brought up some of those issues, especially about e... (by closed account zwA4jE8b)
Help With .txt Files
 
I have this program where I'm trying to get text from a file and use it. Which is all well and good, I've managed to get the specific text from the file that I ...
[7 replies] Last: Yeah that works too! I appreciate your help! I'm going to use your me... (by James Grider)
cannot instantiate abstract class?
 
I am working on a program that uses pure virtual methods, and I have gotten to a point where the same repeated errors appear, cannot instantiate abstract class...
[4 replies] Last: I understand from a design point of view that only a student has a pro... (by anonymous23323124)
Template problem
 
Hi , Given the following code : #include <iostream> using namespace std; template <class T> void print (T obj1 = 0 , T obj2 = 0) { cout << obj1 + obj2 << e...
[4 replies] Last: No. What is 'zero'? Zero can be assigned to an int, a bool, a pointe... (by quirkyusername)
by Null
Question about constructor
 
Hi, I have a question about constructors. Let's say I have code like this: class MyClass { protected: // variables public: MyClass() { ...
[3 replies] Last: I found a way to check what's going on class MyClass { protected: ... (by Null)
C++ TCP client application help required.
 
Hi, can any body send me the working application of TCP client for windows. I tried to work on the microsoft MSDN winsock one, but it didn't work for me. I h...
[3 replies] Last: Are you getting errors when you compile? Are you getting run-time err... (by kooth)
reading from xml file need HELP
 
i am trying to read some data in from an xml file, the data is stored like this: <publisher>BantamBooks</publisher> <ISBN>9780553825480</ISBN> <Title>Wort...
[no replies]
displaying address instead of data
 
I am trying to output some data from a linked list but instead i am just outputting a memory location like 00236E10 , here is my code: myList.addToList(i...
[2 replies] Last: i was making the error of not actually saying what data i wanted from ... (by hastingsdirect)
HELP!!! exception: std::bad_alloc at memory location dbgheap.c
 
Hello all! I am programming a genetic algorithm. Normally, i use only two populations at each iteration, (the same objects). The memory usage grows with the ...
[5 replies] Last: yes indeed i forgot delete rx; as for the letters, they are const glo... (by aprillate)
The variable 'idata' is being used without being initialized.
 
i am trying to input data into a linked list, the instance of the list is called myList and the data i want to input is idata. ProceedingsBook is the class for ...
[5 replies] Last: it just needed a idata = new proceedingsBook; (by hastingsdirect)
C++ Decryptor
 
:D Hello, I am making a C++ console application where the user can encrypt and decrypt text. So far, I have successfully made the encryption part, but am not...
[10 replies] Last: Thanks everyone for your help. I appreciate it! Muhasaresa (by Muhasaresa)
iterator to template map
 
Hi, I created a template class template<class K,class V> class Window It has a stl map member map <K,V> _windowMap; and a method template <class K,...
[2 replies] Last: Denis, thanks a lot. I works. (by tshultz)
Outputting Special Characters in the console (1,2)
 
I was making a simple console program that generates two random 2-D Vectors, Adds them, subtracts them and gives the output in the the Unit-Vector firm as well ...
[20 replies] Last: I guess that the file would have to be saved in UTF-8 since I didn't s... (by Nisheeth)
Header && source file troubles
 
Hey, I have a few questions about headers and how to declare data structures && classes in them. Also why my header that includes all needed libraries or fragme...
[14 replies] Last: dang I really liked 2de as an identifier. Why not e2d? ;P Umm wh... (by Disch)
by fsshl
need help on virtual class
 
Dear C/g++ experts: in the process of installing/building path1.2r2, at make stage, I get compile error about errors: conflicting return type overriding...
[1 reply] : One bottle has acid. Another bottle has orange juice. Drink the conten... (by ne555)
by namcs
Speed of 1D array reading
 
Hello, today I encountered this issue. Basically, I have to do some copy of a 2D array to another, these arrays are stores as 1D array. So here's the code for m...
[3 replies] Last: Thanks jsmith, could you please explain more? I'm not sure how to do i... (by namcs)
August 2011 Pages: 1... 1314151617... 29
  Archived months: [jul2011] [sep2011]

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