General C++ Programming - March 2012 (Page 22)

Why is the copy constructor in this code never called?
 
Hi, I have the following code: class A { public: A(){ cout << "A.ctor()" << endl; } // the others methods have similar couts }; A f() { ...
[2 replies] Last: Thanks : ) (by Jordan Stefanov)
Trouble with containers
 
Hi there. I recently had to create my own container class for a project, however I am having some trouble in getting it to work and would be grateful for any he...
[3 replies] Last: /facepalm Thanks guys, that was a bit stupid on my part. I got so caug... (by ribenaman)
How to get rid of segmentation fault
 
/* for n in items: if n is argument: push n if n is operator: a = pop b = pop push a+n+b answer = pop */ #include<iostream...
[2 replies] Last: Thanks ! Resolved ! (by unkn00wn)
by azi
Drawing shapes
 
Hi
[6 replies] Last: azi, please read this article regarding deleting posts: http://cpluspl... (by Stewbond)
ERROR!! Sum of series
 
This is the series here: X+X^2/3!+X^3/5!+.......+X^n/(2N-1)! I wrote the code but a compile time error occurs which says "call to the undefined function fac...
[1 reply] : I answered your question here. No need to double-post. http://cpluspl... (by Stewbond)
Automatic login
 
Is there a way to make a program that logs you in a program that requires login automatically when you set your ID and Pass. I mean you type your data and it si...
[3 replies] Last: Those are languages. An environment is your OS (Windows, Mac, Linux, e... (by ModShop)
change operation on stack
 
i m learning algorithm for changing Ith element of stack so change algorithm is CHANGE(S,TOP,I) 1 if TOP -I +1 <=0 write('UNDERFLOW'); 2 Return (S[TOP...
[9 replies] Last: thanks viliml...now i got the point... thanks for your answer (by CSharpque)
Opening a txt file outside of your C++ project
 
Here's my dilemma. I have a txt file that is linked with a game I play. I can read in from this file and grab data from it. The only problem with this is the tx...
[4 replies] Last: Alright. That works. Thanks. (by closed account 365X92yv)
someone tell me whats wrong with my code
 
// prac.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int arg...
[1 reply] : Could you elaborate on the problem a little bit more? I don't understa... (by Zhuge)
by h9uest
The most weird problem I've EVER seen
 
I'm working on a problem on topcoder, and below is the code I've got so far. To illustrate the problem, compile the code with "g++ -std=c++0x main.cc" and run ...
[8 replies] Last: Thank you all for the replies! @Pravesh & cire: You are the men! I do... (by h9uest)
help:saddle problem in c
 
//max_colum min_row #include<stdio.h> #include<conio.h> #include<string.h> #define N 20 #define M 20 int min_row(int a ,int m,int i) { int min,j; min ...
[2 replies] Last: ok .man because I'm new user so ......and i try but I can't put my cod... (by Hoann Huy)
Help me about C
 
I'm begin learn c.and i'm from vietnam because I'm speak english not good. my question:Implement :stack as array or as linked list???????
[6 replies] Last: ok .thanks duoas. (by Hoann Huy)
by LB
Copy function at runtime?
 
I have a library with a function that accepts a function pointer and a parameter to give the function. I'm wrapping the thing in a class and so for each instanc...
[5 replies] Last: Nevermind, I misunderstood how it works. It calls the function once ... (by LB)
How to use try\catch\finally\throws.
 
What exactly are these keywords. and an example of their implimentation? every time I try to use these I get errors. I understand they help in catching errors..
[3 replies] Last: clanmjc: You're throwing a const char* but nowhere do you catch it ;) ... (by LB)
by lda106
While Loop Issue
 
I cannot fix my while loop issue. It reads the first line, but then keeps reading the same line. I am reading from a text file. Below is my code: // #incl...
[1 reply] : http://www.parashift.com/c++-faq-lite/input-output.html (by Peter87)
I get compile error on global variable.
 
Hello, file test.h #include"globals.h" int VAR = 23; file test.cpp #include<iostream> #include"test.h" using namespace std; int main() {...
[11 replies] Last: I'll see how it goes with globals, might change later. Thanks for your... (by vincegata)
by oonej
Errors on Linux Machine (but not on my pc) when compiling
 
Is there a definitive answer to these problems? or should i post all my code? want to avoid doing that due to homework assignment No errors when I compile on ...
[3 replies] Last: not sure for the weird errors, but i had a typo in the header file.. a... (by oonej)
Assignment between different objects
 
Hi all. A have two classes: STowar and CTowar-internal. The goal is to assign a STowar object to CTowar_internal object like this: CTowar_interanl twi; STow...
[5 replies] Last: First: { CTowar_internal* ret = new CTowar_internal(); //memory leak ... (by clanmjc)
by Bouya
Difference between namespace and include
 
hi i want to know what is the difference between using namespace and include. in both of them , we call librery to use class in program. So can any one expla...
[10 replies] Last: Hopefully the point was not lost :) (by Moschops)
Mutations Problem
 
Nothing Here
[4 replies] Last: Can you explain me what have you done? If you write mut.resize(5) inst... (by michael10024)
March 2012 Pages: 1... 2021222324... 49
  Archived months: [feb2012] [apr2012]

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