Click here to Skip to main content
15,891,316 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: How to call manged api from unmanaged code? Pin
litu kumar15-Oct-12 2:13
litu kumar15-Oct-12 2:13 
GeneralRe: How to call manged api from unmanaged code? Pin
Richard Andrew x6415-Oct-12 6:46
professionalRichard Andrew x6415-Oct-12 6:46 
QuestionHow to create CLI Interface to access .net API from C++ code? Pin
litu kumar3-Oct-12 0:19
litu kumar3-Oct-12 0:19 
Questionoperato precendance question Pin
Amrit Agr1-Oct-12 22:04
Amrit Agr1-Oct-12 22:04 
AnswerRe: operato precendance question Pin
Richard MacCutchan2-Oct-12 2:58
mveRichard MacCutchan2-Oct-12 2:58 
AnswerRe: operato precendance question Pin
jschell2-Oct-12 8:51
jschell2-Oct-12 8:51 
AnswerRe: operato precendance question Pin
skrtbhtngr15-Nov-12 0:39
skrtbhtngr15-Nov-12 0:39 
QuestionLarge integer class please help Pin
Msemler9328-Sep-12 1:29
Msemler9328-Sep-12 1:29 
Hi my professor gave my class this homework to do without giving us any notes or hints on how to do it. Im so lost and dont know where to start. I've put together some of the member function declarations and one constructor but highly doubt if they're correct.

An array can be used to store large integers one digit at a time. For example, the integer 1234 could bestoredinthearrayabysettinga[0]to1,a[1]to2,a[2]to3,anda[3]to4. However,for this project, you might find it more useful to store the digits backward, that is, place the least significant digit 4 in a[0], 3 in a[1], 2 in a[2], and the most significant digit 1 in a[3].


Design, implement, and test a class in which each object is a large integer with each digit stored in a separate element of a character array. You’ll also need a private member variable to keep track of the sign of the integer (perhaps a Boolean variable), and another private member variable to keep the size (or length) of the integer. The number of digits may grow as the program runs, so the class must use a character pointer (dynamic character array) as a member variable, which stores its value on the dynamic memory freestore (heap). You should also implement other appropriate operators for this class. More specifically, your class should provide default constructor, deep-copy copy constructor, overloaded constructor(s), destructor, deep-copy assignment operator, overloaded arithmetic operators, comparison operators, input and output operators. You should also have a nice driver code to test all implemented member functions and overloaded operators.

C#
#include <iostream>
using namespace std;
class BigInteger
{
private:
    bool sign; //sign of number
    char * arr; //dynamic character array
    int size; //size of array

public:
    BigInteger(int size=0); // default constructor
    BigInteger( const char* arr); // constructor that takes an int as a parameter
    BigInteger( BigInteger& arr); // copy constructor
    ~BigInteger(); // destructor
    void swap(BigInteger&);
    void count( int );
    BigInteger& operator=(const BigInteger& arr);
    BigInteger& operator+(const BigInteger& arr);
    BigInteger& operator-(const BigInteger& arr);

    bool operator==(const BigInteger & arr) const;
    bool operator!=(const BigInteger & arr) const;
    bool operator<(const BigInteger & arr) const;
    bool operator>(const BigInteger & arr) const;
    bool operator>=(const BigInteger & arr) const;
    bool operator<=(const BigInteger & arr) const;

    friend ostream& operator<<(ostream & output, const BigInteger& arr);
    friend istream& operator>>(istream & input, const BigInteger& arr);
};

int main()
{

}

BigInteger::BigInteger(int size) : arr(){

    arr= new char[size+1];
    for(int i=0;i<size;i++)
    {
        arr[i]=' ';
    }
    arr[ size ] = '\0';

}

BigInteger::BigInteger(const char* arr){


}





any help with this program to even get it started would be very appreciated thank you, i'm not asking for just the answer i actually want to know what i'm doing in my class.
AnswerRe: Large integer class please help Pin
Richard MacCutchan28-Sep-12 2:05
mveRichard MacCutchan28-Sep-12 2:05 
AnswerRe: Large integer class please help Pin
jschell28-Sep-12 10:22
jschell28-Sep-12 10:22 
GeneralRe: Large integer class please help Pin
Msemler9329-Sep-12 9:52
Msemler9329-Sep-12 9:52 
GeneralRe: Large integer class please help Pin
jschell30-Sep-12 8:12
jschell30-Sep-12 8:12 
QuestionHOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) Pin
williamjr19-Sep-12 22:09
williamjr19-Sep-12 22:09 
AnswerRe: HOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) Pin
Wes Aday20-Sep-12 3:57
professionalWes Aday20-Sep-12 3:57 
AnswerRe: HOW CAN I CREATE A TRAPEZUM WITH A CIRCLE INSIDE IT??(CODE) Pin
Pete O'Hanlon20-Sep-12 4:40
mvePete O'Hanlon20-Sep-12 4:40 
QuestionWindows Shutdown notification in a MFC Dialog app Pin
Sunil P V13-Sep-12 0:20
Sunil P V13-Sep-12 0:20 
AnswerRe: Windows Shutdown notification in a MFC Dialog app Pin
Richard MacCutchan13-Sep-12 0:27
mveRichard MacCutchan13-Sep-12 0:27 
GeneralRe: Windows Shutdown notification in a MFC Dialog app Pin
Rajesh R Subramanian20-Sep-12 3:36
professionalRajesh R Subramanian20-Sep-12 3:36 
GeneralRe: Windows Shutdown notification in a MFC Dialog app Pin
Richard MacCutchan20-Sep-12 3:56
mveRichard MacCutchan20-Sep-12 3:56 
GeneralRe: Windows Shutdown notification in a MFC Dialog app Pin
Wes Aday20-Sep-12 5:53
professionalWes Aday20-Sep-12 5:53 
GeneralRe: Windows Shutdown notification in a MFC Dialog app Pin
Richard MacCutchan20-Sep-12 6:09
mveRichard MacCutchan20-Sep-12 6:09 
GeneralRe: Windows Shutdown notification in a MFC Dialog app Pin
Sunil P V20-Sep-12 4:58
Sunil P V20-Sep-12 4:58 
QuestionQuestion about ternary operator in initializer list Pin
elelont211-Sep-12 22:29
elelont211-Sep-12 22:29 
AnswerRe: Question about ternary operator in initializer list Pin
jschell12-Sep-12 8:13
jschell12-Sep-12 8:13 
AnswerRe: Question about ternary operator in initializer list Pin
Richard MacCutchan12-Sep-12 22:32
mveRichard MacCutchan12-Sep-12 22:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.