[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

array as pointer passing to function

Posted on 2000-04-30
4
Medium Priority
?
189 Views
Last Modified: 2010-04-02
in the following  code what heppand in particuler..
char *(*fun( int ))(void);??!!
and what code
char *string(void) mean???
then give up example of class template.
0
Comment
Question by:fathikhid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:ntdragon
ID: 2763488
about the first it look like a pointer to function but it look too weird

about the second it a function named string that returns a char* and gets a pointer

about the template

template <class T>
class myclass{
T i;
public:
myclass(T x):i(x){}
~myclass(){}
}
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 2763623
The first one might be a pointer to a function that returns a pointer to a function. But I don't like such declarations and would prefer to see them typedefed in understandable pieces, like
typedef char* (*FuncPtr)(int);
typedef FuncPtr (*FP2)();
FP2 fun;

I think the second one is a function named string that returns a char* and takes no arguments.
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2763659
I'm looking at an "unscrambler algo" for weird definitions and the first, by this algo, says

"fun is a function taking an int parameter returning a pointer to a function taking no parameters returning a char *"

The second one ntdragon and kangaroo have already said what it is.

   Glenn

0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 150 total points
ID: 2764205
fathikhid , i can send you pointer tutprial with reply to same(and more complex) Q. Write you EMail, if you want it.
 
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question