- Melyik tápegységet vegyem?
- Azonnali notebookos kérdések órája
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Milyen egeret válasszak?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Milyen monitort vegyek?
- Dell asztali gépek
- Kormányok / autós szimulátorok topikja
- MILC felhasználók szakmai topikja
- Amlogic S905, S912 processzoros készülékek
Ú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!
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7600X 32/64GB RAM RTX 5060 Ti 16GB GAMER PC termékbeszámítással
- ÁRGARANCIA! Épített KomPhone Ryzen 5 7600X 32/64GB RTX 5070 12GB GAMER PC termékbeszámítással
- LG 77G4 - 77" OLED evo - 4K 144Hz 0.1ms - MLA - 3000 Nits - NVIDIA G-Sync - AMD FreeSync - HDMI 2.1
- ÁRGARANCIA!Épített KomPhone i5 13400F 16/32/64GB RAM RTX 4060 Ti 8GB GAMER PC termékbeszámítással
- Bomba ár! Dell Latitude 5495 - Ryzen 5 I 16GB I 256SSD I 14" FHD I HDMI I Radeon I Cam I W10 I Gari!
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest