Ú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!
- sziku69: Fűzzük össze a szavakat :)
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Hivatalos a OnePlus 13 startdátuma
- VR topik
- Amit látnod kell 80’ – 90’ évek, egész estét betöltő mozi filmjei.
- Milyen hagyományos (nem okos-) telefont vegyek?
- Megtartotta Európában a 7500 mAh-t az Oppo
- Az elmúlt 30 év legjobb processzorai
- PlayStation 5
- További aktív témák...
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7600X 32/64GB RAM RTX 5060 Ti 8GB GAMER PC termékbeszámítással
- HIBÁTLAN iPhone 16 128GB Black-1 ÉV GARANCIA - Kártyafüggetlen, MS4423, 100% Akksi
- HIBÁTLAN iPhone SE 2020 64GB Black-1 ÉV GARANCIA - Kártyafüggetlen, MS4001
- BESZÁMÍTÁS! MSI B650 R7 7700 64GB DDR5 1TB SSD RX 7900 XTX 24GB Lian Li LANCOOL 216 ARGB 850W
- Új! Razer Iskur V2 - Black gamer szék!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

