-6
#include <stdio.h>
#include <string.h>
#define Nome "nome"
#define TAM_STRING 12
void main(void)
{
char * str;
str = (char*) malloc(TAM_STRING);
if(str == NULL)
{
printf("Não já espaço para alocar");
}
else { (str,Nome);
printf("Nome=[%s] tem [%d] caracters",str, strlen(Nome));
int i = 0;
for( i=0;i<strlen(Nome);i++)
{
printf("\nCaracter[%d] = [%c]\n", i , *(str+i));
if(((*(str+i)=='a')|| (*(str+i)=='e'))|| (*(str+i)=='i')||(*(str+i)=='o')||(*(str+i)=='u')) printf("Vogal");
}
}
free(str);
}
And what’s the mistake?
– Rafael Withoeft
What should the code do? What is it doing?
– Math
*(str+i)
is equal tostr[i]
. In my opinion the latest format is easier to read.– pmg
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero