string h include string h include stdio h Slides: 10 Download presentation : ובה פונקציות שימושיות רבות string. h יש ספריה בשם #include <string. h> #include <stdio. h> int main() { char s 1[] = “A string. ”; char s 2[] = “Another string. ”; char s 3[100] = {0}; int l 1 = strlen(s 1); int l 2 = strlen(s 2); strcpy(s 3, s 1); strcat(s 3, s 2); if (!strcmp(s 3, s 1)) printf(“%s = %s”, s 3, s 1); return 0; . © כל הזכויות שמורות. נכתב ע"י יעל ארז } 8 #define TRUE 1 ניהול מערך של שמות #define FALSE 0 int add_name(char* name, char* names[], int len) { int i; for (i=0; i< len && names[i]; i++); if (i == len) return FALSE; names[i] = new char[strlen(name)+1]; if (!names[i]) return FALSE; strcpy(names[i], name); return TRUE; } . © כל הזכויות שמורות. נכתב ע"י יעל ארז 9 ניהול מערך של שמות #define LEN 100 int main() { char* names[LEN] = {0}; add_name(“Danny”, names, LEN); add_name(“Yosi”, names, LEN); return 0; } . © כל הזכויות שמורות. נכתב ע"י יעל ארז 10 #include #include #include Include stdlib h#include stdio.h #include stdlib.h #include string.h#include string.h#include stdio.h #include conio.h #include stdlib.h#include H#include stdio.h int main()Licenseid=string&content=string&/paramsxml=string#include #include using namespace std;Include iostream c++