General C++ Programming - June 2010

by linish
classes and operators
 
Hi, I need help with classes and operators. I'm trying to make a class that is used as a data structure because I need a variable that holds more decimal places...
[2 replies] Last: You do know about Gnu MP, right? No, I have not heard of it, wh... (by linish)
exp with doubles anf floats
 
hi i am running C++ under the GCC compiler on an embedded application. My iterative program (amongst other things) calls the exp function several hundred ti...
[5 replies] Last: http://www.cplusplus.com/reference/clibrary/cmath/exp/ (by Bazzy)
adding vectors
 
I have two vectors and I want to add the second vector on to the end of the first vector. Is that as simple as saying vector1 + vector2 or vector1 << vector2...
[1 reply] : vector1.insert( vector1.end(), vector2.begin(), vector2.end() ); Se... (by moorecm)
by fafner
Client-server for n00bs
 
Hi! Does anyone know of good resources, be it websites, books or whatever, about client-server programming? I'm completely new to this, so I'm looking for ve...
[3 replies] Last: Thanks! That's exactly what I'm looking for;) (by fafner)
g++ linker problems
 
I am trying to test out this source provided here: http://www-personal.umich.edu/~wagnerr/ConfigFile.html But I can't compile to to an executable using g++,...
[9 replies] Last: Well, I knew better than to try to compile ConfigFile.cpp itself, but ... (by RyanCaywood)
What is the use of Static objects.
 
Hi, Can any one explain what is the use of static objects in C++. What I know is static objects are allocated in data segment and It will have its exsista...
[1 reply] : A static object is one with global lifetime, but constrained scope. ... (by kbw)
Client-Server Design Question
 
I'll keep things simple with my question: I have a client-server app i'm writing in which the client will send commands to the server to be executed. My questio...
[4 replies] Last: Fair enough. This will probably make you laugh somewhat but it was in ... (by mcleano)
Premature return from recursion stack
 
I wrote a code for detecting if a given binary tree is a Binary search tree. I have the following in the recursion: int check_BST(node** tree) { ...
[7 replies] Last: jump to that adress and doing a ret, but you'd have to pay attention ... (by helios)
class calling function that is declared outside main()/class
 
Is it possible for a class to call a function that is declared outside the main() or from another class without inheriting the class. eg. class animal{ ....
[1 reply] : You can call find() from any function, as long as find() is declared b... (by hamsterman)
using an inherited typedef?
 
So why can't I use "Index" as follows: template <typename T> class base { public: typedef int Index; }; template <typename T> class child: publ...
[12 replies] Last: I have to come back: in effect, where I have a line typedef HashItera... (by KarlisRepsons)
Shutdown with timer
 
Hi, my program asks for an amount of seconds until the computer must shutdown. This is what I have: int n; cin >> n; system("shutdown -s -t n); I kno...
[5 replies] Last: Just making a small c++ project (just started with c++) called shutdow... (by branic729)
Book on algorithms for programming practice in C++ (or Java or ML) ?
 
Book on algorithms & data structures for programming practice in C++ (or Java or ML) ? I am learning to program in C++/Java/ML (I havent done a whole lot o...
[6 replies] Last: hey Dexter, if you have "The Art of Computer Programming" as a soft-... (by abdallahijazi)
by Alan
math
 
I was thinking lately about math related programming. The I had an interesting thought. (I don't really know the answer). What if multiplication, division and ...
[1 reply] : What if multiplication, division and order of operands did not exist?... (by helios)
by uj2n
Beginner's questions
 
Hello! During the last two years I have gone from Python to Java and now to C++. I have been trying it out for a couple of days and during that time I have b...
[4 replies] Last: #1 There are other cross-platform GUI tool-kits you can try. FLTK an... (by Galik)
A doubt on basics -- memory allocation (1,2)
 
A* a=new A(); A b; I read somewhere that, objecs are always created in the heap and in the above casse the diff is that the first line requires delete and...
[24 replies] Last: Of course. (by helios)
Wont accept value
 
#include <iostream> #include <fstream> using namespace std; int main () { char YesNo; char iFileNam , oFileNam ; do { cout << "Enter th...
[8 replies] Last: This is a better solution. This question has been asked and answered ... (by kempofighter)
by Null
ncurses & stringstream incompatibility
 
I have a weird problem when including both <curses.h> and <sstream> headers: // This doesn't compile and I get a lot of errors #include <curses.h> // only ...
[8 replies] Last: Damn it! I clicked the big green "Download now" button on sourceforge ... (by Null)
How is scanf("%d",&x) faster than cin>>x?
 
I was participating in an online algorithm challenge. It required me to take large inputs at a time. I could not complete the challenge using "cin" for input ...
[2 replies] Last: cin is also tied to cout, which imposes a further performance impact... (by kbw)
Casting to Enum Gets Negative Value
 
I'm having an issue when retrieving a numeric value from a message and attemping to cast it to the appropriate value in an enum I have declare--the value always...
[8 replies] Last: My assembly looks similar to yours, where the assembler is always and... (by kempofighter)
Splitting namespace header and definition.
 
Instead of putting a bunch of related static functions into a class I want to just group them under a namespace instead. Is it possible to split the function d...
[6 replies] Last: If the functions are to be accessible to users of the class, then I'd ... (by jsmith)
June 2010 Pages: 123... 18
  Archived months: [may2010] [jul2010]

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