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

Managed C++/CLI

 
GeneralRe: Image Resizing Methods(Image Processing) Pin
Mark Salsbery7-Jun-07 4:34
Mark Salsbery7-Jun-07 4:34 
AnswerRe: Image Resizing Methods(Image Processing) Pin
Christian Graus6-Jun-07 10:53
protectorChristian Graus6-Jun-07 10:53 
GeneralRe: Image Resizing Methods(Image Processing) Pin
Software_Specialist7-Jun-07 12:05
Software_Specialist7-Jun-07 12:05 
QuestionHow to copy data from one listbox to another? vc++ 2005 Pin
sync_austin5-Jun-07 1:59
sync_austin5-Jun-07 1:59 
AnswerRe: How to copy data from one listbox to another? vc++ 2005 Pin
Christian Graus5-Jun-07 2:46
protectorChristian Graus5-Jun-07 2:46 
QuestionI need help in c++ search in a text file Pin
non light1-Jun-07 23:22
non light1-Jun-07 23:22 
AnswerRe: I need help in c++ search in a text file Pin
Christian Graus2-Jun-07 13:10
protectorChristian Graus2-Jun-07 13:10 
QuestionERROR in reload operator Pin
Chen-XuNuo1-Jun-07 21:59
Chen-XuNuo1-Jun-07 21:59 
#include<iostream>
#include<string>
#include<cmath>
using namespace std;

class Complex{
public:
Complex();
Complex(double);
Complex(double,double);

void write() const ;
bool operator==(const Complex& ) const ;
bool operator!=(const Complex& ) const ;
Complex operator-();
friend ostream& operator<<(ostream& out,Complex& c);
private:
double real;
double imag;
};

Complex::Complex(){
real=imag=0.0;
}
Complex::Complex(double re){
real=re;
imag=0.0;
}
Complex::Complex(double re,double im){
real=re;
imag=im;
}
void Complex::write() const {
cout<<real<<"+"<<imag<<'i'<<endl;
}
bool Complex::operator==(const Complex& u ) const {
if(real==u.real&&imag==u.imag)
return true;
else return false;
}
bool Complex::operator!=(const Complex& u ) const {
if(real!=u.real||imag!=u.imag)
return true;
else return false;
}

Complex Complex::operator-(){
real=-real;
imag=-imag;
}

ostream& operator<<(ostream& out,const Complex& c)
{
return out<<c.real<<"+"<<c.imag<<'i'<<endl;
}

int main(){
Complex c1(2.3,5.6);
Complex c2(1.4,2.5);
if(c1==c2) {
c1.write();
c2.write();
cout<<c1<<endl;
cout<<c2<<endl;
}
return 0;
}
I have declared :friend ostream& operator<<(ostream& out,Complex& c);
but why the error says:
cannot access private member declared in class 'Complex'?

AnswerRe: ERROR in reload operator Pin
Christian Graus2-Jun-07 13:14
protectorChristian Graus2-Jun-07 13:14 
GeneralRe: ERROR in reload operator Pin
Chen-XuNuo3-Jun-07 18:54
Chen-XuNuo3-Jun-07 18:54 
GeneralRe: ERROR in reload operator Pin
Christian Graus4-Jun-07 11:18
protectorChristian Graus4-Jun-07 11:18 
QuestionGetProcesses in C++ Pin
gapfulgence1-Jun-07 11:04
gapfulgence1-Jun-07 11:04 
AnswerRe: GetProcesses in C++ Pin
Mark Salsbery1-Jun-07 11:44
Mark Salsbery1-Jun-07 11:44 
AnswerRe: GetProcesses in C++ Pin
Christian Graus1-Jun-07 11:47
protectorChristian Graus1-Jun-07 11:47 
QuestionUI thread not allowing Garbage Collection? Pin
SE_GEEK1-Jun-07 7:08
SE_GEEK1-Jun-07 7:08 
QuestionNEW dialog ID problem Pin
sonavi1-Jun-07 2:11
sonavi1-Jun-07 2:11 
AnswerRe: NEW dialog ID problem Pin
Mark Salsbery1-Jun-07 5:09
Mark Salsbery1-Jun-07 5:09 
QuestionWindows Forms Application with mixed code Requires an annoying Console Window Pin
earlgraham31-May-07 12:31
earlgraham31-May-07 12:31 
AnswerRe: Windows Forms Application with mixed code Requires an annoying Console Window Pin
Mark Salsbery31-May-07 14:38
Mark Salsbery31-May-07 14:38 
GeneralRe: Windows Forms Application with mixed code Requires an annoying Console Window Pin
earlgraham1-Jun-07 5:24
earlgraham1-Jun-07 5:24 
GeneralRe: Windows Forms Application with mixed code Requires an annoying Console Window Pin
Mark Salsbery1-Jun-07 5:44
Mark Salsbery1-Jun-07 5:44 
GeneralRe: Windows Forms Application with mixed code Requires an annoying Console Window Pin
earlgraham1-Jun-07 10:37
earlgraham1-Jun-07 10:37 
GeneralRe: Windows Forms Application with mixed code Requires an annoying Console Window Pin
Mark Salsbery1-Jun-07 12:14
Mark Salsbery1-Jun-07 12:14 
Questionradioc box problem Pin
sonavi30-May-07 23:09
sonavi30-May-07 23:09 
AnswerRe: radioc box problem Pin
Paul Conrad14-Jul-07 13:41
professionalPaul Conrad14-Jul-07 13:41 

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.