Hirdetés
- VR topik
- Vezetékes FEJhallgatók
- Milyen billentyűzetet vegyek?
- Milyen Android TV boxot vegyek?
- Kormányok / autós szimulátorok topikja
- AMD Navi Radeon™ RX 9xxx sorozat
- Amlogic S905, S912 processzoros készülékek
- PC-k milliói kerülhetnek veszélybe idén
- Multimédiás / PC-s hangfalszettek (2.0, 2.1, 5.1)
- Bambu Lab 3D nyomtatók
Ú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!
- Revolut
- VR topik
- Family Link
- Debrecen és környéke adok-veszek-beszélgetek
- World of Tanks - MMO
- Vezetékes FEJhallgatók
- Motorola Signature - mielőtt aláírnád...
- Hosszú premier előzetest kapott az Arknights: Endfield
- gban: Ingyen kellene, de tegnapra
- Megerősítést kapott a kompakt csúcsmobil OnePlus 15T érkezése
- További aktív témák...
- 15.gen! Intel Core ULTRA 9 285K (24mag!) +hűtött VRM-es Z890 lap! GAR/SZÁMLA (Te nevedre kiállítva)!
- Gamer PC - Ryzen 5 5500 - RTX 3070 AORUS - 16 GB RAM - 500 GB NVMe SSD
- EKSÖN! Microsoft Surface Prémium Érintős Laptop Ultrabook 13,5" -65% i5-7300 8/256 Tűéles Retina
- Xiaomi 15T Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- ZOTAC GeForce RTX3080 AMP HOLO LHR 10GB Dobozos
- Tekken 7 Playstation 4
- Apple iPhone 15 Pro Max 256 GB White Titanium 1 év Garancia Beszámítás Házhozszállítás
- Samsung Galaxy S20 Ultra / 12/128GB / Kártyafüggetlen / 12Hó Garancia
- 234 - Lenovo Legion Pro 7 (16IAX10H) - Intel Core U9 275HX, RTX 5080
- í kilenc! AKCIÓS PRECÍZIÓS KÉSZÜLÉK! 7670 i9-12950HX 32GB RAM 1TB SSD Nvidia RTX A3000 12GB 1 év gar
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


