Ú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!
- Házimozi haladó szinten
- Autós topik
- Váratlanul lehet VRAM-gyilkos a DirectX 12 érkező funkciója
- One otthoni szolgáltatások (TV, internet, telefon)
- Mégis mi értelme az Xbox PC-nek, ha limitálja a hardverválasztékot?
- OpenWRT topic
- Merész dizájn és új teleobjektív az iPhone 17 Pro mobilokban
- Iqos cigaretta
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Kerékpárosok, bringások ide!
- További aktív témák...
- Apple MacBook Air M2,8/256GB,Dobozával,12 hónap garanciával
- Dell Latitude 5520 / i7-1185G7 /16gb ram / 512gb SSD / Világitó Bill / WIN11
- RÉSZLETRE .OPCIONÁLIS. Asus ROG Strix G614JVR-N4014W SZÁMLÁVAL GARANCIÁVAL
- Nitro AN515 57 15.6" FHD IPS i7-11600H RTX 3070 32GB 512GB NVMe magyar vbill gar
- Egyedi matricák gyártása, akár kis mennyiségben is! Kattints a további infókért.
- GYÖNYÖRŰ iPhone 11 128GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3264, 100% Akkumulátor
- Samsung Galaxy S23+ 512GB, Kártyafüggetlen, 1 Év Garanciával
- Telefon felvásárlás!! Apple Watch Series 6/Apple Watch Series 7/Apple Watch Series 8
- LG 49SE3D-B 49" FullHD LED Monitor
- DELL Precision Dual USB-C Thunderbolt Dock - TB18DC
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest