Új hozzászólás Aktív témák
-
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!
- Akciófigyelő: jelentős kedvezménnyel nyit a Honor 600
- Vezetékes FÜLhallgatók
- Kerékpárosok, bringások ide!
- Samsung Galaxy S26 Ultra - fontossági sorrend
- Nem indul és mi a baja a gépemnek topik
- Huawei Watch GT 6 és GT 6 Pro duplateszt
- Anglia - élmények, tapasztalatok
- Analóg-mechanikus hibrid billentyűzetekkel újít a Logitech
- LEGO klub
- Redmi Note 13 Pro 5G - nem százas, kétszázas!
- További aktív témák...
- I7 2600K - RX 580 4Gb - 16Gb DDR3
- BONTATLAN Új iPhone 17 PRO 256-512GGB Független 1év Apple GARANCIA Deák Térnél Azonnal Átvehető.
- Bomba ár! HP ProBook 430 G3 - i5-6GEN I 4GB I 500GB I HDMI I 13,3" HD I Cam I W10 I Garancia!
- Bomba ár! Lenovo Tablet 10 - Intel N4100 I 8GB I 128SSD I 10,1" WUXGA I HDMI I Cam I W11 I Gari!
- Eladó egy Xiaomi k50 ultra (Xiaomi 12t pro) snapdragon cpu
- Itachi! Felsőkategóriás Gamer PC! Csere-Beszámítás! R7 9800X3D/ 9070XT / 32GB DDR5 / 2TB Nvme SSD
- 27% - Yodoit PTM15 hordozható 15,6 monitor! 1920x1080p / IPS / hangszórókkal
- Eladó Samsung Galaxy A55 5G 8/128GB Lemon / 12 hónap jótállás
- ASUS Vivobook OLED S513E notebook, laptop
- ÚJ RCB R10S ELEKTROMOS ROLLER kb 50% áron, dobozban, 3 hó gar.:
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
