BleepingComputer.com: Functions in C++?

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Functions in C++?

#1 User is offline   TelMeDragon 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 80
  • Joined: 10-January 07

Posted 29 April 2009 - 01:37 AM

I'm not really understanding what a function is. From what I've gathered, it's the equivalent of a method in Java? I'm not a long time practioner in both of these languages, I'm actually learning them at the same time, so forgive me if my terminology is incorrect.
Posted Image

#2 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,814
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 29 April 2009 - 09:32 AM

Yes you are right. Method in Java and functions in C++ are similar.
[url="http://www.avast.com/"]avast! free antivirus[/url]

#3 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 29 April 2009 - 10:49 AM

The only difference between a method and a function is that sometime one needs to declare a prototype for a function, whereas there is no such need for a prototype in Java. Other than that, they are a language-particular means of identifying an independent section of code.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users