Hirdetés
Ú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!
- VR topik
- Sapphi: StremHU | Source – Self-hostolható Stremio addon magyar trackerekhez
- Kodi és kiegészítői magyar nyelvű online tartalmakhoz (Linux, Windows)
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- iPhone topik
- Redmi Note 14 5G - jól sikerült az alapmodell
- S.T.A.L.K.E.R. 2: Heart of Chornobyl
- Amlogic S905, S912 processzoros készülékek
- Amazfit Active 2 NFC - jó kör
- Ingatlanos topic!
- További aktív témák...
- GYÖNYÖRŰ iPhone 13 mini 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3060
- BESZÁMÍTÁS! MSI B450M R5 5600X 32GB DDR4 512GB SSD RX 6700XT 12GB Zalman S2 TG GIGABYTE 750W
- Samsung Galaxy A33 5G 128GB, Kártyafüggetlen, 1 Év Garanciával
- HIBÁTLAN iPhone 14 Pro 128GB Space Black -1 ÉV GARANCIA - Kártyafüggetlen
- ÁRGARANCIA!Épített KomPhone i5 12400F 16/32/64GB RAM RTX 5060 Ti 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopszaki Kft.
Város: Budapest


