-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestThis.cpp
More file actions
49 lines (40 loc) · 733 Bytes
/
Copy pathTestThis.cpp
File metadata and controls
49 lines (40 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <cstdlib>
#include <csignal>
using namespace std;
class nota{
public:
nota();
void Imprime();
nota *ponteiro();
void print(nota*);
void repeticao();
private:
int valor;
};
void nota::print(nota *x){ cout<<"\n"<<x<<endl; cout<<x->valor<<endl;}
nota::nota(){valor=5;}
void nota::Imprime(){
nota *i;
cout<<"Imprimindo\t"<<valor<<endl;
cout<<"Imprimindo\t"<<this<<endl;
i=ponteiro();
cout<<i<<endl;
exit(1);
print(i);
}
void nota::repeticao(){
char a='t';
while(1){
cout<<"Passei por aqui"<<endl;
if(a==16) {break;}
cout<<"Mas não por aqui"<<endl;
}
}
nota *nota::ponteiro(){ return this;}
int main(){
nota notas;
// notas.Imprime();
notas.repeticao();
return 0;
}