Hirdetés
- Milyen billentyűzetet vegyek?
- Gaming notebook topik
- AMD Navi Radeon™ RX 9xxx sorozat
- NVIDIA® driverek topikja
- Duplázik a NAND is: a Samsung 100%-os áremelésben gondolkodik
- A legrosszabb CPU-k – az ExtremeTech szerint
- Épített vízhűtés (nem kompakt) topic
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Apple MacBook
- Melyik tápegységet vegyem?
Ú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!
- Használt iPhone 15 Pro felvásárlás gyors, korrekt, biztonságos
- Csak kipróbált Mini-Erőmű! Mini-PC Ryzen 7 7840HS 16GB 512GB 1 év garancia
- Apple iPhone 15Pro 128GB Kártyafüggetlen 1év Garanciával
- Bomba ár! Dell Latitude 5400 - i5-8265U I 16GB I 512SSD I 14" HD I HDMI I Cam I W11 I Gari
- LG 75QNED86T3A / QNED / 75" - 164 cm / 4K UHD / 120Hz / HDR Dolby Vision / FreeSync Premium / VRR
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


