Hirdetés
Új hozzászólás Aktív témák
-
Lortech
addikt
válasz
Szőkecica
#2419
üzenetére
Ha windowson vagy, akkor a nem szabvány gnu kiterjesztés getline problémás lesz, meg lehet, hogy a főiskolán, egyetemen se fogadják el.
Egyébként a programkód megnyomása ennyit szúr be a szövegdobozba, ha kézzel bemásolod:
[M][ C ][ /C ][/M]
S így használhatod:
[M][ C ]formázandó programkód[ /C ][/M]A [ C ]-knél a space-t ki kell venni.
-
Sk8erPeter
nagyúr
válasz
Szőkecica
#2419
üzenetére
#include <stdio.h>
int main()
{
int bytes_read;
int nbytes = 100;
char *my_string;
puts ("Please enter a line of text.");
/* These 2 lines are the heart of the program. */
my_string = (char *) malloc (nbytes + 1);
bytes_read = getline (&my_string, &nbytes, stdin);
if (bytes_read == -1)
{
puts ("ERROR!");
}
else
{
puts ("You typed:");
puts (my_string);
}
return 0;
}"The getline function reads an entire line from a stream, up to and including the next newline character. It takes three parameters. The first is a pointer to a block allocated with malloc or calloc. (These two functions allocate computer memory for the program when it is run. See Memory allocation, for more information.) This parameter is of type char **; it will contain the line read by getline when it returns. The second parameter is a pointer to a variable of type size_t; this parameter specifies the size in bytes of the block of memory pointed to by the first parameter. The third parameter is simply the stream from which to read the line."
Ú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!
- PlayStation 3
- Fejhallgató erősítő és DAC topik
- Hitelkártyák használata, hitelkártya visszatérítés
- Cudy routerek
- Milyen TV-t vegyek?
- One otthoni szolgáltatások (TV, internet, telefon)
- Épített vízhűtés (nem kompakt) topic
- Apple Watch
- Milyen alaplapot vegyek?
- Milyen autót vegyek?
- További aktív témák...
- G.SKILL Trident Z5 Royal Neo Silver 64GB (2x32GB) DDR5 6000MHz CL30 - Élettartam garancia
- XFX Quicksilver AMD Radeon RX 7800 XT Magnetic Air - Arctic White - Alza garancia 2028.02.25.
- Apple iPhone 15 128GB,Újszerű,Dobozával,12 hónap garanciával
- ASUS Vivobook S14 OLED - Ultra 5 226V - 16/512GB - Garancia
- 32GB DDR5 RAM-ok tesztelve, garanciával, számlával (a Te nevedre kiállítva)!
- GYÖNYÖRŰ iPhone 14 Pro 128GB Space Black-1 ÉV GARANCIA - Kártyafüggetlen, MS3781, 100% Akkumulátor
- Bomba ár! HP ProBook 450 G3 - i3-6G I 8GB I 128SSD I DVDRW I HDMI I 15,6" HD I Cam I W11 I Gar!
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7500F 32/64GB RAM RX 7800 XT 16GB GAMER PC termékbeszámítással
- HIBÁTLAN iPhone 13 128GB Red -1 ÉV GARANCIA - Kártyafüggetlen, MS3536,100% Akkumulátor
- Gamer PC-Számítógép! Csere-Beszámítás! R5 8400F / RX 6800 16GB / 32GB DDR5 / 1TB SSD!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


