General C++ Programming - March 2009 (Page 18)

by dirbax
C++ to Mathematics
 
Hi , is it possible to transform the following code to math int F( int n ) { int r=0; int mid=...
[6 replies] Last: What about this function int F( int n , int a, int b ) { int r... (by dirbax)
by tition
Why return object& when overloading operator=?
 
Hi all, Why do most c++ tutorials on overloading operator= suggest that the operator= return obje...
[3 replies] Last: Thanks to both, all understood! I wouldn't want anyone who uses exp... (by tition)
Derived Vector Class
 
My class is causing an error explosion... Hundreds of errors from: .../bits/vector.tcc What is wro...
[6 replies] Last: I notice that you have min and max functions. You don't need them. R... (by jsmith)
by wanky
need to make timer.
 
i created a casino program with seven games in it. my professor told me that it was a simple program...
[1 reply] : Try to see if you can find useful functions in <ctime> header http://... (by Bazzy)
fatal error using .close()
 
Hey there. I'm having trouble closing a file of all things. I'm using fstream and .close() to do ...
[4 replies] Last: Hi, You should also share the file you are trying to read from. I th... (by mm148881)
How Can I Insert Zeros in the Middle of a String of IP? C/C++
 
I wrote a piece of code that does the following: 1. Get IP from user in this format xx.xx.xx.xx ...
[7 replies] Last: seymore15074 (354): Best answer A+... Thanks to all who helped! ... (by f ben isaac)
hey i need to find out how to do this..
 
stopping a program when the number entered is zero my main says: cout << "Enter a number to tes...
[2 replies] Last: @bufbill: your if statements are assignments not comparisons. (by jsmith)
C++ Printing
 
__ opens a dialog box that allows users to select printers other than the default printer. A. Prin...
[1 reply] : This goes in the Windows forum. (by helios)
Favorite (or anti-) Error Messages
 
Are there error messages you love (or loathe) to see? One of mine is "long long long is too long ...
[4 replies] Last: I believe MacOS calls refers to segmentation faults as "bus errors", j... (by helios)
cout did not appear and Nesting IF ELSE
 
Hi, while doing my assignment im somehow stucked somewhere which i didnt know why and i need some h...
[4 replies] Last: seymore15074 posted the actual answer just before I posed my comment... (by guestgulkan)
by anan
Linked list and polynomials
 
hi there how can i access different data type in a linked list?(say p has int char,double etc) how...
[1 reply] : Consider this code structure struct node { int i; char c; ... (by kevinchkin)
decompression
 
I have stored some data in a file.txt which is hello ho3w2 are you. How can I open this file in c c...
[1 reply] : Refer to your same post in beginners section. (by kevinchkin)
File Metadata
 
Hi Guys, I was wondering if somehow we can get file's "Where from" info. I am using stat() to get...
[2 replies] Last: It's HFS+ (by kevinchkin)
Function overloading
 
Hi, I've been working with a tree-like structure and encountered the following issue that I'll try t...
[7 replies] Last: Why can't you turn the problem around? class A { public: voi... (by jsmith)
Overloading operator+
 
I cant put operator+ in the class so I'm lost. Rational operator+( const Rational& A, const Rati...
[2 replies] Last: Line 9 -- remove the C. return Rational( Num, Den ); You... (by jsmith)
Problems with Compiling?
 
Hi all, I am having problems trying to compile 2 files, a.cpp and test.cpp. So my problem is that...
[17 replies] Last: Yeah, i know my lecturer is crap. I told him it doesn't make sense too... (by shaoen01)
Exception catching not displayed?
 
Hi all, I have 2 methods with one method 1 throwing exception and method 2 that is catching the e...
[4 replies] Last: Thanks, i think it works now! (by shaoen01)
by jrohde
Overloading operator+ with two arguments
 
Hello all, Is it possible to overload the "+" operator in the following way? (This is just a s...
[4 replies] Last: Thanks guys - makes sense. Yeah, I realize the + operator was illogic... (by jrohde)
malloc pointers created and returned within the same function
 
I'm trying to locate suspected memory leaks in someone else's code. I don't have access to the orig...
[3 replies] Last: Good point. Run Valgrind on it... (by seymore15074)
Sparse Matrix Implementation
 
The following is my implementation of a sparse matrix class. Feel free to comment on my bad coding s...
[8 replies] Last: I was hoping for something a bit more specific (yes indeed that was a ... (by turbozedd)
March 2009 Pages: 1... 161718192021
  Archived months: [feb2009] [apr2009]

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