This file contains 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 <string.h> | |
void funcao_correta(FILE *out, int idade) { | |
fprintf(out,"a pessoa tem %d anos", idade); | |
} | |
void funcao_incorreta(FILE *out, int idade) { | |
fprintf(out,"a pessoa tem %d anos", idade*2); | |
} |
This file contains 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
// Este programa le a imagem PNG de um mapa e encontra o ponto em que | |
// o territorio se divide igualmente entre Norte e Sul, Leste e Oeste. | |
// A lib PNG++ usa uma funcao que o Windows nao tem, entao quebramos o galho com uma macro. | |
// https://stackoverflow.com/questions/11718915/alternative-api-of-strerror-r-for-windows-os | |
#define strerror_r(errno,buf,len) strerror_s(buf,len,errno) | |
#include <png.hpp> // e' a biblioteca que sabe ler, gravar e manipular imagens em formato PNG. | |
// Esta e' a classe da lib PNG++ que representa uma imagem. Vamos chama-la apenas de Imagem. | |
typedef png::image< png::rgb_pixel > Imagem; |