Thread: What do we mean by this ?

  1. #1
    Registered User
    Join Date
    Aug 2016
    Posts
    3

    What do we mean by this ?

    Hi everybody
    I'm trying to understand a code written by someone
    in the code i found something like

    Code:
     Name *Name_of_function(arguments) {body of the function}
    what dose that mean, I'm already know that the function can be like

    Code:
     int Name_of_function (arguments) {body of the function }
    so, what is that mean ... I'm beginner in c++

    thanks

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    What part is confusing to you? Your example is lacking context and explanation. Provide the full example.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User
    Join Date
    Aug 2016
    Posts
    3
    Code:
    Name *Name_of_function(arguments) {body of the function}
    for example
    Code:
    Libnucnet__Zone *Libnucnet__createZoneArray( const Libnucnet *)

  4. #4
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Ah, I know where you're confused. What they're doing is returning a pointer to a Name type.

    C and C++ are a little funny in where you can choose to put the * character. It's for this reason that I think it's a little bit more readable to type:
    Code:
    Name* Name_of_function(arguments) { /* ... */ }
    If you aren't familiar with pointers, there's ton of resources you can use to read all about them.

Popular pages Recent additions subscribe to a feed

Tags for this Thread