Created
March 9, 2017 11:53
-
-
Save nenodias/1b3446b3d017122a629468f00d7a11c9 to your computer and use it in GitHub Desktop.
Teste Cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <iostream> | |
| #include <string.h> | |
| #include <malloc.h> | |
| using namespace std; | |
| struct Pessoa{ | |
| char *nome; | |
| }; | |
| int main(){ | |
| struct Pessoa p; | |
| p.nome = (char *) malloc(sizeof(char) * 100 ); // Allocando Memória para a string | |
| strcpy(p.nome, "Neno");// Copiando a string | |
| cout << "Olá Mundo " << p.nome << "!!!" << endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment