skip to main | skip to sidebar

sahucpp

Saturday, August 25, 2007

Funtion return array of integer

/*
This example says about the function takes no argument and returns pointer to array
of 3 interger.
*/

#include < iostream >
using namespace std;

int arr[]={11,22,33};

int (*f())[3]
{
cout << arr[1];
return &arr;

}


int main()
{
int(*(*g)())[3]= f;
(**g());
}


Cheer,
Sahu
Posted by Haramohan Sahu at 12:32 AM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2007 (28)
    • ►  October (6)
    • ►  September (3)
    • ▼  August (19)
      • Why do i need dynamic casting in c++?
      • Funtion return array of integer
      • Some more example of Function pointer.
      • Can i cast char* to a unsigned char* or vice versa ?
      • What is make file and what it does ?
      • c++ links
      • Problem with Implicit conversion
      • Explicit Constructors
      • How to Avoid Complex Declarations
      • Problem with your Key Boad ,No proble, there is a...
      • Function returning Pointer to array of function po...
      • Function returning a pointer to a function
      • What Is a Function Pointer
      • How to read function pointer ,sahu has one formula...
      • function pointer in c example
      • Function Pointer in a class or stucture
      • sed command 's use
      • grep command
      • unix stuffs