לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #1  
ישן 15-01-2012, 17:12
צלמית המשתמש של lion032
  lion032 lion032 אינו מחובר  
 
חבר מתאריך: 29.08.05
הודעות: 592
שלח הודעה דרך ICQ אל lion032
compilation error מוזר

אני מקבל את השגיאה הבאה
fatal error: opening dependency file ex7b.d: Invalid argument

אין לי שמץ של מושג מאיפה זה הגיע

אשמח אם תוכלו לעזור לי לאתר את הבעיה

אני עובד באקליפס והקוד מצורף (אל תתיחסו לזה שהוא לא שלם)

הסימון של השגיאה תמיד מופע ב { האחרון

קוד:
//--------------------------------Include Section------------------------------ #include <iostream> #include <cstdlib> #include <iomanip> #include <cstring> //--------------------------------Using Section-------------------------------- using std::cin; using std::cout; using std::endl; using std::setw; //--------------------------------Const Section-------------------------------- const int MAX_STRS = 10, MAX_STR_LEN = 8, MAX_TEXT_LEN = 100 ; //------------------------------- void read_in_2_dict(char dict[][MAX_STR_LEN]); void read_2_text(char text[]); int find_longst_sub_str(char dict[][MAX_STR_LEN], char text[MAX_TEXT_LEN], int& sub_str_leng); int find_word_leng(char text[MAX_TEXT_LEN], int txt_i); bool check_if_in_dict(char dict[][MAX_STR_LEN], char text[MAX_TEXT_LEN], int txt_i); bool check_curr_word(char dict[MAX_STR_LEN], char text[MAX_TEXT_LEN], int txt_i); void convert_text_2_upper(char text[MAX_TEXT_LEN]); //--------------------------------Main Section--------------------------------- int main() { char dict[MAX_STRS][MAX_STR_LEN], text[MAX_TEXT_LEN]; int longst_sub_str_strt, sub_str_leng; read_in_2_dict(dict); cin.get(); read_2_text(text); cout << find_longst_sub_str(dict, text, sub_str_leng) << " " << sub_str_leng << endl; return (EXIT_SUCCESS); } //---------------- int find_longst_sub_str(char dict[][MAX_STR_LEN], char text[MAX_TEXT_LEN], int& sub_str_leng) { int word_leng, curr_sub_str_strt; for(int txt_i = 0 ; txt_i < MAX_TEXT_LEN && text[txt_i] != '\0' ; txt_i += word_leng) { if(isalpha(text[txt_i])) { word_leng = find_word_leng(text, txt_i); if(check_if_in_dict(dict, text, txt_i)) ; } } } //------------------------------------ bool check_if_in_dict(char dict[][MAX_STR_LEN], char text[MAX_TEXT_LEN], int txt_i) { for(int dict_r_i = 0 ; dict_r_i < MAX_STRS ; dict_r_i++) { if(!(check_curr_word(dict[dict_r_i], text, txt_i))) continue; else return true; } return false; } //--------------------------------- bool check_curr_word(char dict[MAX_STR_LEN], char text[MAX_TEXT_LEN], int txt_i) { for(int txt_cell_i = txt_i; (isalpha(text[txt_cell_i])) ; txt_cell_i++) { if(text[txt_cell_i]!=dict[txt_cell_i]) return false; } return true; } //------------------ int find_word_leng(char text[MAX_TEXT_LEN], int txt_i) { int txt_leng = txt_i; while(txt_leng < MAX_TEXT_LEN && (isalpha(text[txt_leng]))) txt_leng++; return (txt_leng); } //------------------------------- void read_in_2_dict(char dict[][MAX_STR_LEN]) { for(int str_i = 0 ; str_i < MAX_STRS ;str_i++) { cin>> setw(MAX_STR_LEN) >> dict[str_i]; for(int conv_i = 0 ; conv_i < MAX_STR_LEN && dict[str_i] != '\0'; conv_i++) dict[str_i][conv_i] = toupper(dict[str_i][conv_i]); } } //----------------------- [LEFT] void read_2_text(char text[MAX_TEXT_LEN]) { cin.getline(text, MAX_TEXT_LEN); convert_text_2_upper(text); } //-------------------------------------------------- void convert_text_2_upper(char text[MAX_TEXT_LEN]) { for(int conv_i = 0 ; conv_i < MAX_TEXT_LEN && text[conv_i] != '\0'; conv_i++) text[conv_i] = toupper(text[conv_i]); }
_____________________________________
חופ"ל טירונים במיל'

תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 14:21

הדף נוצר ב 0.08 שניות עם 10 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2024 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר