im cracking up with this one, im at this since 11 o clock this morning, i want the number of characters in the new string, "word+i=length"Code:#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char word[10]; /* Declare a string */ int i; /* Declare our variables */ int sl; int s; int total; puts("Enter your word: "); /* Get the word from the user */ gets(word); printf("Enter your number:"); /* Get the shift value */ scanf("%d",&i); sl=strlen(word); /* Get the string length */ s=sizeof(word); /* Get the sizeof the string */ total=strncat(word, i,8); printf("\nThe lenght of the string is %d",sl); printf("\nThe size is %d\n",s); printf("Your word with the number added is: "); /* Print out the result */ printf("%s %d\n\n",word, i); printf("\nThe new lenght of the string is %s", total); printf("\nThe size is %d\n",s); }
thanks in advance