Ú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."
Sk8erPeter
Ú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!
- NVIDIA GeForce RTX 3060 Ti / 3070 / 3070 Ti (GA104)
- Győr és környéke adok-veszek-beszélgetek
- NVIDIA GeForce RTX 4060 / 4070 S/Ti/TiS (AD104/103)
- Óra topik
- Elektromos (hálózati és akkus) kéziszerszámok, tapasztalatok/vásárlás
- Formula-1
- Kerékpárosok, bringások ide!
- Gitáros topic
- Windows 7
- Politika
- További aktív témák...
- Dell Latitude 5300 2in1,13.3",FHD,i7-8665U,16GB DDR4,256GB SSD,WIN10,Touch
- Dell Latitude 5300 2in1,13.3",FHD,i5-8365U,16GB DDR4,256GB SSD,WIN10,Touch
- - MAKULÁTLAN - ASUS ZENBOOK PRO 16X 4K OLED - i9-12900H, RTX 3060, 32GB, 1TB, Win11PRO, 3 ÉV GARI
- ÚJ ASUS ROG ZEPHYRUS G16 - 16" WQXGA 240Hz - i9-13900H - 16GB - 1TB - RTX 4050 - Win10 - Garancia
- Dell Latitude 7490,14",FHD,i5-8350U,16GB DDR4,256GB SSD,WIN10,TOUCH
Állásajánlatok
Cég: Alpha Laptopszerviz Kft.
Város: Pécs
Cég: Ozeki Kft.
Város: Debrecen