- R_volution médialejátszók
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Azonnali VGA-s kérdések órája
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- ROG Strix G16 notebook: tökéletes harmónia
- HDD probléma (nem adatmentés)
- Véget vetne a hibrid magdizájnnak az Intel?
- Fujifilm X
- Milyen monitort vegyek?
- Bluetooth hangszóró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!
- EVGA SuperNOVA 750W GT 80 Plus Gold full moduláris tápegység / 53 hónap Alza.hu garancia
- Surface Laptop 4 Touch 13.5 Retina Ryzen7 4980U 4.4Ghz 16GB 512GB Radeon RX Vega8 Win11 Pro Garancia
- Gigabyte AORUS B550I PRO AX ITX Rev 1.2 / Beszámítás OK!
- HP 15 Zbook Studio G8 FHD IPS i7-11850H vPro 32GB 512GB SSD Nvidia A2000 Studio Win11 Pro Garancia
- Dell 14 Latitude 7420 FHD IPS i7-1185G7 4.8Ghz 16GB 512GB SSD Intel Iris XE Win11 Pro Garancia
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest