Thread: cin.get() question

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    10

    cin.get() question

    what are the parenthesis in
    Code:
    cin.get()
    used for?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    That is how you call functions. The function parameters going inside the parenthesis. In this case, there are no function parameters (since get() doesn't take any).
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    198
    If not for the parentheses, there would be no way to know if it is a function with no parameters or a variable.

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    266
    the dot after cin means that you want to use a function from within 'cin', and after you write any function you need to write (), inside of these parenthesis you can write instructions called parameters..but you can also leave them blank.

  5. #5
    Registered User QuestionKing's Avatar
    Join Date
    Jan 2009
    Posts
    68
    Quote Originally Posted by rodrigorules View Post
    ..but you can also leave them blank.
    What he means by that is you leave them blank, only when the function you are calling doesn't take any parameters. Your function call must match the function you are calling, both in spelling and parameters.
    Function tutorial here.
    Asking a question you already know the answer to might teach you something you did not know...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cin.get() problem
    By Cilius in forum C++ Programming
    Replies: 20
    Last Post: 07-28-2005, 05:32 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM