Hirdetés
- Rap, Hip-hop 90'
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- Gurulunk, WAZE?!
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- hcl: Asus RT-AC57u unbrick vs TFTP :D
- Luck Dragon: Alza kuponok – aktuális kedvezmények, tippek és tapasztalatok (külön igényre)
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- GoodSpeed: Te hány éves vagy?
Ú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
Hirdetés
● olvasd el a téma összefoglalót!
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- MSI 17 Pulse FHD IPS 144Hz i7-13700H 14mag 16GB 512GB SSD Nvidia RTX 4060 8GB 140W Win11 Garancia
- BESZÁMÍTÁS! SAPPHIRE B650M R7 8700F 16GB DDR5 512GB SSD RTX 4060Ti 8GB Zalman S2 TG ADATA 600W
- Apple iPhone 12 Pro Max 128GB, Kártyafüggetlen, 1 Év Garanciával
- HIBÁTLAN iPhone 13 mini 128GB Pink -1 ÉV GARANCIA -Kártyafüggetlen, MS3844
- Új, Aktiválatlan iPhone 17 Pro (256 GB) (rendelhető)
Á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

