Cin.get and cin.getline

What are the differences between cin.get and cin.getline?

Also here he has used cin.get(); where there is no argument. Why? Where is value being assigned if there’s no argument?

cin . get() takes the input character by character but getline() is used to get a line from a file line by line

char ch;
cin.get(ch);
while(ch!=’$’){
cout<<ch;
ch=cin.get();

}

for this code
if input file contain
Abcd
efgh$
output is
Abcd
efgh

and for
char str[100];
cin.getline(str,100);
cout<<str;
output is
Abcd

we can also apply delimiter to this (by default it is ‘\n’)
for ex
char str[100];
cin.getline(str,100,’$’);
cout<<str;
output will be
Abcd
efgh

i hope you understand now

in the video we write cin.get(); after taking n
this is because
after n there will be a newline ( this is come when you press enter and remain in input stream because cin ignore newline ) so we have to remove it from input stream that’s why we write cin.get();

we don’t save the charcter from cin.get()
if you want you can write like
char ch=cin.get();