ממש מתחיל ב- C ../images/Emo101.gif
אני מנסה ללמוד C לבד, ולא כל כך הבנתי את הקטע של המחרוזות
( מישהוא יכול להסביר לי מה לא בסדר בסקריפט שלי?
אני מנסה ללמוד C לבד, ולא כל כך הבנתי את הקטע של המחרוזות
#include <stdio.h> #include <conio.h> int thelen(int len[]); int *add(int first[], int second[]); int main(void) { int c[20],cc[20],ccc,i=0; printf("Your first string: "); scanf("%s\0",&c); printf("Yout second string: "); scanf("%s\0",&cc); printf("\nThe first is: %s\0", c); printf("\nThe second is: %s \0", cc); printf("\n\nThe first len is: %d", thelen(c)); printf("\nThe second len is: %d \n", thelen(cc)); ccc=*add(c,cc); printf("The concat of first and second: %s", *add(c,cc)); return 0; } int thelen(int len[]) { int i; for(i=0; len; i++); return i; } //add string to other string int *add(int to[], int from[]) { int i=0,j=0; int sum[20]; while(sum != to){ sum = to; i++;} for(; from[j]; j++){ i++; sum=from[j]; } return sum; }