Ú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!
- Nagyon is lát fantáziát a Socket AM4-ben az ASRock
- Retro teló rajongók OFF topicja
- PlayStation 5
- Cisco vizsgák (CCNA, CCNP, CCIE)
- Huawei Watch GT 6 és GT 6 Pro duplateszt
- Váratlanul ledobta asztali csúcs-Ryzenjét az AMD
- WoW avagy World of Warcraft -=MMORPG=-
- Gyúrósok ide!
- Kerékpárosok, bringások ide!
- Apple MacBook
- További aktív témák...
- Xiaomi Redmi 10C 64GB, Kártyafüggetlen, 1 Év Garanciával
- áthajtós érintős 360 szinteÚJ Dell 16 Plus 2-in-1 Ultra 7 258V INTEL Arc 140V 32GB 1TB SSD 16QHD+
- GYÖNYÖRŰ iPhone 12 Pro Max 128GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS4564, 100% AKKSI
- Veszünk: PS5 Fat/Slim/Digital/Pro konzolt, játékokat, Portalt stb. Kérj ajánlatot!
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7700X 32/64GB RAM RTX 5070 Ti 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


