Hi,
I want to make a program that reads a string.
But I would like to read only characters, neither numbers nor special characters(@,#$%^&*()!). Also, no spaces between characters.
#include <stdio.h>
#include <string.h>
char *enter_a_string(int maxcharacters)
{
char *ptr;
int len;
printf("Enter string : ");
char array[50];
do{
scanf("%s",array);
len = strlen(array);
if(len > maxcharacters)
{
printf("Maximum %d characters. Try again : ",maxcharacters);
}
}while(len > maxcharacters);
ptr = array;
return ptr;
}
int main()
{
char array[50];
strcpy(array,get_personal_elements(15));
}
Could someone help me please?
Thanks a lot