473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

array of functions

wats the declaration for array of functions with int parameters?wats
the prototype of printf?
thanx a lot

Dec 15 '05 #1
10 2807
"raghu" writes:
wats the declaration for array of functions with int parameters?wats
the prototype of printf?
thanx a lot


thereaintnun luk at anbook urwelcum
Dec 15 '05 #2
"raghu" <ra*********@gmail.com> writes:
wats the declaration for array of functions with int parameters?
wats the prototype of printf?


Please take the time to write proper English. If it's not your native
language we'll certainly make allowances, but some effort would be
appreciated.

There's no such thing as an array of functions. Are you looking for
an array of pointers to functions?

The prototype of printf() should be in your documentation. In C99,
it's

int printf(const char * restrict format, ...);

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 15 '05 #3
raghu wrote:
wats the declaration for array of functions with int parameters?wats
the prototype of printf?
thanx a lot


Hello, Raghu.

I have found that correct spelling, grammar and punctuation often
prevent misunderstandings. I urge you to avoid abbreviations such as
"wats" and "thanx".

To declare an array of *pointers to* functions taking a single int and
returning void, do something like this:
void a(int);
void b(int);
void (*array_of_poitner_to_func[])(int ) = { a, b };

By the way, I used the "cdecl" and "gcc -Wall -pedantic -ansi" programs
to help me answer your question. If you have access to them, each of
them is a great resource.

You should never have to specify printf's prototype in your program. In
fact, you must never specify printf's prototype in your program. (This
restriction may be technically incorrect. I'm sure someone will correct
me.) Always provide the following line:
#include <stdio.h>
in any program that invokes printf(). Having said that, printf's
prototype is one of these, depending upon which version of C you are using:
int printf(const char * restrict format, ...); /* C99 */
int printf(const char * format, ...); /* C90 */

I found this information in the publicly-available *draft* C99 standard
here:
http://www.open-std.org/jtc1/sc22/wg...69/n869.txt.gz

Note that this draft varies somewhere from the final, published standard.

Finally, please read the FAQ for this newsgroup. You can find it by
specifying "comp.lang.c FAQ" at www.google.com.

I hope this helps.

Rob
Dec 15 '05 #4
i'm sorry if i had hurt you Mr. Thompson and Mr.Rob.But thanks a lot
for your valuable responses.

Dec 16 '05 #5
"raghu" <ra*********@gmail.com> writes:
i'm sorry if i had hurt you Mr. Thompson and Mr.Rob.But thanks a lot
for your valuable responses.


Constructive criticism doesn't mean I'm hurt; it's just advice.

Spaces between sentences are also helpful.

And please read <http://cfaj.freeshell.org/google/>.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 16 '05 #6
raghu wrote:
i'm sorry if i had hurt you Mr. Thompson and Mr.Rob.But thanks a lot
for your valuable responses.

I doubt they are seriously hurt. However, you should include
context in order to make any sense. See sig. below.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Dec 16 '05 #7
In article <QO******************************@maineline.net> ,
Chuck F. <cb********@maineline.net> wrote:
raghu wrote:
i'm sorry if i had hurt you Mr. Thompson and Mr.Rob.But thanks a lot
for your valuable responses.

I doubt they are seriously hurt. However, you should include
context in order to make any sense. See sig. below.


You (and others, such as Keith) are wasting your breath. They'll never get
it. And I'll tell you why.

Imagine that there's a mouse - and the mouse is the Usenet. You and I can
see that it is a mouse and we behave accordingly. But now there is a class
of users (we'll call them "googlers") that are wearing these funny weird
glasses that make them see not a mouse, but an elephant. Seeing an
elephant (i.e., the Usenet as a web page), they also behave accordingly.
And no amount of verbiage from us is going to convince them that it's not
an elephant - that it is only a mouse.

To make this more clear, to a googler, it doesn't make any sense to "quote"
(whatever the heck that is...), in fact, to do so would be absurd, when all
the rest of the articles in the thread are right there in front of their
faces (just as clear as the trunk on that mouse, er, elephant). And no
amount of verbiage from us is going to convince them not to believe what
they see. The point is you can *never* convince someone that what they see
isn't reality. The only way you can address the problem is to help them
fix their eyesight (or help them remove their funny glasses).

Dec 16 '05 #8
On 2005-12-16, Kenny McCormack <ga*****@yin.interaccess.com> wrote:
To make this more clear, to a googler, it doesn't make any sense to
"quote" (whatever the heck that is...), in fact, to do so would be
absurd, when all the rest of the articles in the thread are right
there in front of their faces (just as clear as the trunk on that
mouse, er, elephant).


Given that quoting is equally customary on web forums on such interfaces
as invision, ubb, phpbb, and so on, i think it's more likely the fact
that the reply button doesn't quote, then any fundamental problem with
the idea of quoting.

That's to say nothing of such places as slashdot or fark, where people
will actually go to the trouble of quoting text by hand [which I think
is an oddity particularly on slashdot, which is the only of _any_ of the
interfaces mentioned, google included, which does not use a flat
interface by default. Perhaps it's an artifact of the high proportion of
technically literate users, who may have used usenet before.]
Dec 16 '05 #9
Jordan Abel <jm****@purdue.edu> writes:
On 2005-12-16, Kenny McCormack <ga*****@yin.interaccess.com> wrote: [the usual]

[snip]

Please don't feed the troll.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 16 '05 #10
Jordan Abel wrote:
On 2005-12-16, Kenny McCormack <ga*****@yin.interaccess.com> wrote:
To make this more clear, to a googler, it doesn't make any sense to
"quote" (whatever the heck that is...), in fact, to do so would be
absurd, when all the rest of the articles in the thread are right
there in front of their faces (just as clear as the trunk on that
mouse, er, elephant).


Given that quoting is equally customary on web forums on such interfaces
as invision, ubb, phpbb, and so on, i think it's more likely the fact
that the reply button doesn't quote, then any fundamental problem with
the idea of quoting.

That's to say nothing of such places as slashdot or fark, where people
will actually go to the trouble of quoting text by hand [which I think
is an oddity particularly on slashdot, which is the only of _any_ of the
interfaces mentioned, google included, which does not use a flat
interface by default. Perhaps it's an artifact of the high proportion of
technically literate users, who may have used usenet before.]


+-------------------+ .:\:\:/:/:.
| PLEASE DO NOT | :.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you, | ( (_) )
| Management | /`-vvv-'\
+-------------------+ / \
| | @@@ / /|,,,,,|\ \
| | @@@ /_// /^\ \\_\
@x@@x@ | | |/ WW( ( ) )WW
\||||/ | | \| __\,,\ /,,/__
\||/ | | | jgs (______Y______)
/\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
================================================== ============

--
Some useful references about C:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://www.eskimo.com/~scs/C-faq/top.html>
<http://benpfaff.org/writings/clc/off-topic.html>
<http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/> (C99)
<http://www.dinkumware.com/refxc.html> (C-library}
<http://gcc.gnu.org/onlinedocs/> (GNU docs)
Dec 16 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
4
by: Mark Hannon | last post by:
I am trying to initialize an array only once so it can be seen & used by any functions that need it. As I understand it, if a variable is declared by itself outside of any functions, its scope is...
32
by: Carson | last post by:
Hi , Is there a very efficient way to set a double array to 0 ? (I have tried memset, but the result doesn't look correct.) Carson
5
by: Steve | last post by:
Can anyone tell me if I can have an array of functions that take a variable number of parameters? If it is possible I'd like to know how to declare the array and the functions as its elements. I am...
7
by: arkobose | last post by:
hey everyone! i have this little problem. consider the following declaration: char *array = {"wilson", "string of any size", "etc", "input"}; this is a common data structure used to store...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
9
by: JoeC | last post by:
I am crating a new version of my map game and my map will be a 2d array. I had problems trying to create a 2d array dynamically, in fact C++ won't let me do it. My question is how to create the...
14
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is...
5
by: Immortal Nephi | last post by:
I would like to design an object using class. How can this class contain 10 member functions. Put 10 member functions into member function pointer array. One member function uses switch to call...
3
by: David K in San Jose | last post by:
I'm using managed (CLR) C++ in VS2005 to create a Windows app that contains a form named "MyForm". In the code for that form I'm trying to invoke some static functions by using an array of function...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.