{"id":190,"date":"2012-04-12T13:50:17","date_gmt":"2012-04-12T12:50:17","guid":{"rendered":"http:\/\/csipet.web.elte.hu\/?p=190"},"modified":"2012-04-12T13:50:17","modified_gmt":"2012-04-12T12:50:17","slug":"9-ora","status":"publish","type":"post","link":"https:\/\/peter.csonka.hu\/hu\/blog\/2012\/04\/9-ora\/","title":{"rendered":"9. \u00f3ra"},"content":{"rendered":"<p><a href=\"https:\/\/docs.google.com\/document\/d\/1VSTohTGvtEUPWPGh7QY8tvdkKuWKLb6yoCQgDlKWzi0\/edit\">https:\/\/docs.google.com\/document\/d\/1VSTohTGvtEUPWPGh7QY8tvdkKuWKLb6yoCQgDlKWzi0\/edit<\/a><\/p>\n<pre lang=\"c\" line=\"1\">\n#include <stdio.h>\n#include <stdlib.h>\n#define MAX_STR 128\n\ntypedef struct _ITALGEP{\n    int rekesz_id;\n    char italnev[MAX_STR];\n    int egysegar;\n    int darab;\n    char feltoltesi_datum[MAX_STR];\n    int eladott_db;\n    int forgalom;\n    int osszes_eladott_db;\n    int osszes_forgalom;\n    int ures;\n    int szin;\n} ITALGEP;\n\nint main(){\n    ITALGEP gep;\n    printf (\"rekesz_id: \");\n    scanf (\"%d\", &gep.rekesz_id);\n    FILE *fw = fopen(\"szoveg\",\"wb\");\n    while(gep.rekesz_id!=-1){\n   \t printf (\"italnev: \");\n   \t scanf (\"%s\", gep.italnev);\n\n   \t fwrite(&gep ,sizeof(gep),1,fw);\n   \t \n   \t printf (\"rekesz_id: \");\n   \t scanf (\"%d\", &gep.rekesz_id);\n    }\n    fclose(fw);\n\n    char adat[100];\n    FILE *fp = fopen(\"szoveg\",\"rb\");\n    if(fp!=NULL){\n   \t while(fgets(adat,100,fp)!=NULL){\n   \t\t printf(\"Az olvasott elem: %sn\", adat);\n   \t }\n   \t fclose(fp);\n    } else {\n   \t printf(\"Hibas fajlnev!\");\n    }\n    \n    return 0;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/docs.google.com\/document\/d\/1VSTohTGvtEUPWPGh7QY8tvdkKuWKLb6yoCQgDlKWzi0\/edit #include #include #define MAX_STR 128 typedef struct _ITALGEP{ int rekesz_id; char italnev[MAX_STR]; int egysegar; int darab; char feltoltesi_datum[MAX_STR]; int eladott_db; int forgalom; int osszes_eladott_db; int osszes_forgalom; int ures; int szin; } ITALGEP; int main(){ ITALGEP gep; printf (&#8222;rekesz_id: &#8222;); scanf (&#8222;%d&#8221;, &#038;gep.rekesz_id); FILE *fw = fopen(&#8222;szoveg&#8221;,&#8221;wb&#8221;); while(gep.rekesz_id!=-1){ printf (&#8222;italnev: &#8222;); scanf (&#8222;%s&#8221;, gep.italnev); fwrite(&#038;gep ,sizeof(gep),1,fw); printf (&#8222;rekesz_id: &#8222;); scanf (&#8222;%d&#8221;, &#038;gep.rekesz_id); } fclose(fw); char adat[100]; FILE *fp = fopen(&#8222;szoveg&#8221;,&#8221;rb&#8221;); if(fp!=NULL){ while(fgets(adat,100,fp)!=NULL){ printf(&#8222;Az olvasott elem: %sn&#8221;, adat); } fclose(fp); } else { printf(&#8222;Hibas fajlnev!&#8221;); } return 0; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-190","post","type-post","status-publish","format-standard","hentry","category-szamitogepes-alapismeretek-2"],"_links":{"self":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/comments?post=190"}],"version-history":[{"count":0,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts\/190\/revisions"}],"wp:attachment":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/media?parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/categories?post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/tags?post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}