Ú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!
- Autós topik
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Kínai és egyéb olcsó órák topikja
- mefistofeles: Az elhízás nem akaratgyengeség!
- PlayStation 5
- exHWSW - Értünk mindenhez IS
- iPhone topik
- 10 egyszerű trükk Samsung telefonokhoz
- Kerékpárosok, bringások ide!
- One otthoni szolgáltatások (TV, internet, telefon)
- További aktív témák...
- Használt Lenovo ThinkPad T14 G1 laptop i5, 16GB RAM, 256GB m.2 SSD, 1 év garancia
- Dell Alienware AW3225QF (31,6", OLED, 3840x2160, 240Hz, 1700R, FreeSync, G-SYNC)
- HP Laptop 15s-fq2996nz + monitor + egér és billenzyűzet + fejhallgató (INGYEN FOXPOST!)
- ASUS TUF VG279QM1A Gaming Monitor 280Hz GARANCIÁLIS!
- Canon EF 28-300mm f/3.5-5.6L IS USM - Újszerű -
- TELJES KÖRŰ IT BESZERZÉS
- iPhone 14 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS4422
- ÁRGARANCIA!Épített KomPhone Ryzen 5 7500F 32/64GB DDR5 RTX 5060 8GB GAMER PC termékbeszámítással
- ThinkPad T14s Gen 2 i5-1135G7 16GB 512GB FHD 1 év garancia
- BESZÁMÍTÁS! Gigabyte B760M i5 14600K 16GB DDR4 512GB SSD RX 9060 XT 16GB Asus A31 PLUS TG ARGB 650W
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs

