Hirdetés
- iPhone topik
- Okosóra és okoskiegészítő topik
- Akciófigyelő: Jelentősen olcsóbban megvehető a Honor Magic8 Pro
- OnePlus 15 - van plusz energia
- Fontos frissítés érkezik a OnePlus 13-ra
- Titan 2 Elite néven érkezik egy újabb BlackBerry-szerű Unihertz
- Milyen okostelefont vegyek?
- Google Pixel topik
- Kicsinálja az S26 Ultra a fóliagyártókat
- Honor Magic6 Pro - kör közepén számok
Ú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!
- Samsung Galaxy A33 5G / 6/128GB / Kártyafüggetlen / 12Hó Garancia /
- Xbox One S 1 TB + kontroller 6 hó garancia, számlával!
- Gamer PC-Számítógép! Csere-Beszámítás! I7 8700K / RTX 3070 / 32GB DDR4 / 1TB SSD
- 14" Dell Latitude laptopok: 5400, 5480, 5490, 7480, E6410, E6440, E5450 / SZÁMLA + GARANCIA
- HIBÁTLAN iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3139
Á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


