- Okosóra és okoskiegészítő topik
- Így fotóz és ennyire melegszik a Galaxy S26 Ultra
- Xiaomi 15 - kicsi telefon nagy energiával
- One mobilszolgáltatások
- Samsung Galaxy Z Fold7 - ezt vártuk, de…
- Apple iPhone 16 Pro - rutinvizsga
- Honor Magic V5 - méret a kamera mögött
- iPhone topik
- Pebble - az átgondolt okosóra
- Vivo X200 Pro - a kétszázát!
Új hozzászólás Aktív témák
-
Hali!
Valamiért nem akar ez működni és nem tudom miért.Annyira nem lenne érdekes,mert másik kóddal működik,de meg szeretnék tanulni programozni amihez értenem is kell.HA már VIK akkor csatlakozok,hogy a goto-ért exit jár

#inlude <stdio.h>
#include <stdlib.h>
#include <conio.h>
main ()
{
File*fp
char c;
fp=fopen("C:\prog\blabla.txt","r");
if(fp==NULL){printf("Hiba a fajl olvasasnal");exit(1);}
while(!feof(fp)){
c=fgetc(fp);
fputc(c,stdout);
}
fclose(fp);
exit(0);
}Ez nem akar működni,VS8 fatal error C1021: invalid preprocessor command 'inlude'
Code blocks: progi\main.c|1|invalid preprocessing directive #inlude|
progi\main.c|6|warning: return type defaults to `int'|
progi\main.c||In function `main':|
progi\main.c|7|error: `File' undeclared (first use in this function)|
progi\main.c|7|error: (Each undeclared identifier is reported only once|
progi\main.c|7|error: for each function it appears in.)|
progi\main.c|8|error: `fp' undeclared (first use in this function)|
progi\main.c|8|error: syntax error before "char"|
progi\main.c|9|warning: implicit declaration of function `fopen'|
progi\main.c|9|warning: unknown escape sequence '\p'|
progi\main.c|9|warning: unknown escape sequence '\P'|
progi\main.c|10|warning: implicit declaration of function `printf'|
progi\main.c|11|warning: implicit declaration of function `feof'|
progi\main.c|12|error: `c' undeclared (first use in this function)|
progi\main.c|12|warning: implicit declaration of function `fgetc'|
progi\main.c|13|warning: implicit declaration of function `fputc'|
progi\main.c|13|error: `stdout' undeclared (first use in this function)|
progi\main.c|15|warning: implicit declaration of function `fclose'|
||=== Build finished: 8 errors, 9 warnings ===|Helyette ez müxik,de még alakítani,kell hogy beolvassam dinamikus adatszerkezetbe.
#include <stdio.h>
void main()
{
int c;
FILE *fp;
if( (fp = fopen("C:\\prog\\blabla.txt","rt")) == NULL )
{
printf("\nHiba a blabla.blabl megnyitásánál !");
// Kilépés a programból
exit(0);
}
// Elôolvasás.
c = fgetc(fp);
// Amíg nincs file vége.
while( !feof(fp) )
{
printf("\nA beolvasott karakter : %c",c);
// Olvassa a következôt.
c = fgetc(fp);
}
// A file lezárása.
fclose(fp);
}
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Hgst es seagate 500gb 2.5 hdd
- Hostpost.hu VPS - Webtárhely Bérlés
- Radeon Rx 6600XT/ I5 8400/ 16GB Corsair/ 1TB M2/ 128GB Sata SSD/ 500GB HDD/ Win11
- ÚJ Dobozos Lenovo Thinkpad T14s G6 Tartós Laptop 14" -60% Snapdragon 32/1TB FHD+ 20Hó Gar
- Bontatlan! Új Lenovo Thinkpad T14 G5 Tartós Üzleti Laptop 14" -45% Ultra 7 165U 16/512 FHD+ Magyar!
- BESZÁMÍTÁS! Intel Core i9 14900K 24 mag 32 szál processzor garanciával hibátlan működéssel
- Lenovo Thinkcentre M920t Tower/ M920s SFF / számla, garancia
- Samsung Galaxy Book PRO 2 /i7-1260P/16GB/512SSD/AMOLED/13.3/Intel Iris Xe/Gari
- 44999 FORINT MacBook Pro 17" i7 2.6 GHz 8GB RAM 8 ciklus az akkuban!
- Keresünk S24/S24+/24 Ultra/S24 FE
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


