Translated lines 22 - 55 (#33745)
Updated the language to portuguese in lines 22 to 55
This commit is contained in:
@ -19,29 +19,29 @@ A seguir, o exemplo em que a mesma função print () está sendo usada para impr
|
|||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
class printData {
|
class imprimirDados {
|
||||||
public:
|
public:
|
||||||
void print(int i) {
|
void imprimir(int i) {
|
||||||
cout << "Printing int: " << i << endl;
|
cout << "Imprimindo int: " << i << endl;
|
||||||
}
|
}
|
||||||
void print(double f) {
|
void imprimir(double f) {
|
||||||
cout << "Printing float: " << f << endl;
|
cout << "Imprimindo float: " << f << endl;
|
||||||
}
|
}
|
||||||
void print(const string& s) {
|
void imprimir(const string& s) {
|
||||||
cout << "Printing string: " << s << endl;
|
cout << "Imprimindo string: " << s << endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
printData pd;
|
imprimirDados pd;
|
||||||
|
|
||||||
// Call print to print integer
|
// Chamada para imprimir inteiro
|
||||||
pd.print(5);
|
pd.print(5);
|
||||||
|
|
||||||
// Call print to print float
|
// Chamada para imprimir float
|
||||||
pd.print(500.263);
|
pd.print(500.263);
|
||||||
|
|
||||||
// Call print to print string
|
// Chamada para imprimir string
|
||||||
pd.print("Hello C++");
|
pd.print("Hello C++");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -50,9 +50,9 @@ A seguir, o exemplo em que a mesma função print () está sendo usada para impr
|
|||||||
|
|
||||||
Quando o código acima é compilado e executado, ele produz o seguinte resultado -
|
Quando o código acima é compilado e executado, ele produz o seguinte resultado -
|
||||||
```
|
```
|
||||||
Printing int: 5
|
Imprimindo int: 5
|
||||||
Printing float: 500.263
|
Imprimindo float: 500.263
|
||||||
Printing string: Hello C++
|
Imprimindo string: Hello C++
|
||||||
```
|
```
|
||||||
|
|
||||||
### Sobrecarga de Operador em C ++
|
### Sobrecarga de Operador em C ++
|
||||||
@ -99,4 +99,4 @@ Saída para o programa acima
|
|||||||
```
|
```
|
||||||
4 + i3
|
4 + i3
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user