Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-23-2013, 02:34 PM   PM User | #1
007julien
Regular Coder

 
Join Date: May 2012
Location: France
Posts: 121
Thanks: 0
Thanked 18 Times in 16 Posts
007julien is an unknown quantity at this point
C++ lists

Hello,
I try to work with C++...
How to retrieve the m_Digits list of int, with this hh (and particularly the GetDigits function) for a class of big Integers ?
Code:
class Integer
{
	short m_Sign; // m_Sign<0 <=> this<0
	list<int> m_Digits;

public:
	Integer();
	Integer(int n);
	Integer(const char*);
	Integer(const Integer& n);

	short GetSign() const {return m_Sign;};
	const list<int>& GetDigits() const {return m_Digits;};
	The function to use to retrieve the digits 
	const list<int>& GetDigits() const {return m_Digits;};
	//...
};
Integer abs(const Integer& a);
Integer fact(Integer a);
Integer pgcd(Integer a, Integer b);
Integer ppcm(Integer a, Integer b);
Integer pow(Integer a, int b);
Integer pow(Integer a, Integer b);
// The new function to build 
Integer sqrt(Integer a);
I do not clearly understand the definition of the line
Code:
const list<int>& GetDigits() const {return m_Digits;};
and I am unable to declare a list<int> variable to retrieve this list.

Thanks !
007julien is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:15 AM.


Advertisement
Log in to turn off these ads.