Skip to content
Snippets Groups Projects
Commit 2352e750 authored by Armando Luiz Nicolini Delgado's avatar Armando Luiz Nicolini Delgado :nerd:
Browse files

* Mudou links simbólicos de 'utils.*' para links 'hard'

parent 1b16e495
No related branches found
No related tags found
No related merge requests found
alt/sizeof_01.c
\ No newline at end of file
#include <stdio.h>
int main ()
{
char vetor_01[5], var_01;
int vetor_02[6], var_02;
float vetor_03[7], var_03;
double vetor_04[6], var_04;
long int var_05;
long long int var_06;
short int var_07;
struct cls {
int a;
char b[5];
int c[10];
};
printf("\n");
printf("\n");
printf("\n");
printf(" ================================== \n");
printf("| TIPO | TAMANHO EM BYTES |\n");
printf("|==================================|\n");
printf("| char | %2lu |\n", sizeof(char));
printf("| int | %2lu |\n", sizeof(int));
printf("| unsig int | %2lu |\n", sizeof(unsigned int));
printf("| short int | %2lu |\n", sizeof(short int));
printf("| long int | %2lu |\n", sizeof(long int));
printf("| long long int | %2lu |\n", sizeof(long long int));
printf("| float | %2lu |\n", sizeof(float));
printf("| double | %2lu |\n", sizeof(double));
printf("| long double | %2lu |\n", sizeof(long double));
printf("| struct cls | %2lu |\n", sizeof(struct cls));
printf(" ==================================|\n");
printf("| void * | %2lu |\n", sizeof(void *));
printf("| char * | %2lu |\n", sizeof(char *));
printf("| int * | %2lu |\n", sizeof(int *));
printf("| short int * | %2lu |\n", sizeof(short int *));
printf("| long int * | %2lu |\n", sizeof(long int *));
printf("| float * | %2lu |\n", sizeof(float *));
printf("| double * | %2lu |\n", sizeof(double *));
printf("| long double * | %2lu |\n", sizeof(long double *));
printf(" ================================== \n");
printf("\n");
printf("\n");
printf(" ====================================== \n");
printf("| VARIAVEL | TAMANHO EM BYTES |\n");
printf("|======================================|\n");
printf("| char v[5] | %2lu |\n", sizeof vetor_01 );
printf("| int v[6] | %2lu |\n", sizeof vetor_02 );
printf("| float v[7] | %2lu |\n", sizeof vetor_03 );
printf("| double v[6] | %2lu |\n", sizeof(vetor_04));
printf("| char var | %2lu |\n", sizeof var_01 );
printf("| int var | %2lu |\n", sizeof var_02 );
printf("| short int var | %2lu |\n", sizeof(var_07));
printf("| long int var | %2lu |\n", sizeof(var_05));
printf("| long long int var | %2lu |\n", sizeof(var_06));
printf("| float var | %2lu |\n", sizeof var_03 );
printf("| double var | %2lu |\n", sizeof(var_04));
printf(" ====================================== \n");
printf("\n");
printf("\n");
}
alt/utils-00.c
\ No newline at end of file
#include <stdio.h>
#include "utils.h"
/* Retorna tempo em milisegundos
Forma de uso:
double tempo;
tempo = timestamp();
<trecho de programa do qual se deseja medir tempo>
tempo = timestamp() - tempo;
*/
double timestamp(void)
{
struct timeval tp;
gettimeofday(&tp, NULL);
// printf("\n*** %7.10lf ms %7.10lf ms\n", tp.tv_sec*1.0e3, tp.tv_usec*1.0e-3);
return((double)(tp.tv_sec*1.0e3 + tp.tv_usec*1.0e-3));
}
alt/utils-00.h
\ No newline at end of file
#ifndef __UTILS_H__
#define __UTILS_H__
#include <stdlib.h>
#include <sys/time.h>
double timestamp(void);
#endif // __UTILS_H__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment