R
Hier hast du schon mal was, was kompiliert:
Hinter den Zeilen, die ich geändert hab, steht ein großes "HIER".
Und noch nebenbei: "nicht funktionieren" ist keine Fehlerbeschreibung.
#include <iostream>
#include <windows.h> // HIER
using namespace std;
void inputValue(int& a, int& b)
{
cout<<"Geben Sie Ihre Zahlen an :"<<endl;
cin>>a;
cin>>b;
}
void inputValue(int *pa, int *pb)
{
cout<<"Geben Sie Ihre Zahlen an :"<<endl;
cout<<" A : ";
cin>>*pa;
cout<<endl<<" B : ";
cin>>*pb;
}
void outputValue(int a, int b)
{
cout<<" A ist = "<<a<<endl;
cout<<" B ist = "<<b<<endl;
}
void outputVlaue(int *pa, int *pb)
{
cout<<" Zeiger A ist = "<<pa<<endl;
cout<<" Zeiger B ist = "<<pb<<endl;
}
void swap(int *pa, int *pb)
{
int tmp;
tmp=*pa;
*pa=*pb;
*pb=tmp;
}
int main()
{
int a, b;
int *pa=&a;
int *pb=&b;
inputValue(a,b);
swap(pa,pb);
outputValue(a,b);
cout<<"Choose a operation:"<<endl;
cout<<endl;
cout<<"(1)- Output of A and B :"<<endl;
cout<<"(2) Print A and B:"<<endl;
cout<<"(3) Change A and B:"<<endl;
cout<<"(4) zeiger A and B"<<endl;
cout<<"(5) programm quit:"<<endl;
int opt; // HIER
cin>>opt;
switch(opt)
{
case 1:
cout<<" geben sie A und B ein:"<<endl;
cout<<" A : ";
cin>>a;
cout<<endl<<" B : ";
cin>>b;
break;
case 2:
cout<<" A ist = "<<a<<endl;
cout<<" B ist = "<<b<<endl;
break;
case 3:
swap( pa, pb);
outputValue( a, b);
;
break;
case 4:
cout<<" Zeiger A ist = "<<*pa<<endl;
cout<<" Zeiger B ist = "<<*pb<<endl;
break;
case 5:
cout << "bye" << endl;; // HIER
break;
default:
cout<<"wrong typed:"<<endl;
}
system("pause");
}