#include #include void stringcopy(char*,char*); //declaring stringcopyfunction void getacr(char*); int main() { //int i=0; char string[50]; char copy[50]; printf("Type a string for an acronym: "); // storing string from command line to the array string fgets(string, sizeof(string), stdin); stringcopy(copy,string); //using string copy function i made(defined below) to get a copy of the string to preserve. fprintf(stdout,"\n\n%s\nACRONYM: ",string); getacr(copy);//using getacr function I made(defined below) to get acr of the copy. return(0); } void getacr(char* string) { printf("\n%c is at address of %p\n",*(string),(string)); while (*string!='\0') { string++; if ((*(string)==' ')||(*(string)=='-')) fprintf(stdout,"%c is at this address %p\n" ,*(string+1),(string+1)); } printf("\n"); //printf("%c",*(string)); //exit(0); } //printf("%c", *(copy+2)); void stringcopy(char *copy,char *string) //define stringcopy functions { while(*string!=EOF) // Loop while copy is not at string termination. { *copy=*string;//set the dereferenced value of string to copy then shift up to next adress space with next chat string++; copy++; } *copy='\0'; }