Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > array of functions

Reply
Thread Tools

array of functions

 
 
raghu
Guest
Posts: n/a
 
      12-15-2005
wats the declaration for array of functions with int parameters?wats
the prototype of printf?
thanx a lot

 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      12-15-2005
"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


 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      12-15-2005
"raghu" <> 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) kst- <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.
 
Reply With Quote
 
Rob Adams
Guest
Posts: n/a
 
      12-15-2005
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
 
Reply With Quote
 
raghu
Guest
Posts: n/a
 
      12-16-2005
i'm sorry if i had hurt you Mr. Thompson and Mr.Rob.But thanks a lot
for your valuable responses.

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-16-2005
"raghu" <> 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) kst- <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.
 
Reply With Quote
 
Chuck F.
Guest
Posts: n/a
 
      12-16-2005
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/>
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      12-16-2005
In article <> ,
Chuck F. <> 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).

 
Reply With Quote
 
Jordan Abel
Guest
Posts: n/a
 
      12-16-2005
On 2005-12-16, Kenny McCormack <> 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.]
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-16-2005
Jordan Abel <> writes:
> On 2005-12-16, Kenny McCormack <> wrote:

[the usual]
>

[snip]

Please don't feed the troll.

--
Keith Thompson (The_Other_Keith) kst- <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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const and array of array (of array ...) Mara Guida C Programming 3 09-03-2009 07:54 AM
length of an array in a struct in an array of structs in a struct in an array of structs Tuan Bui Perl Misc 14 07-29-2005 02:39 PM
Shared functions vs Non-Shared Functions tshad ASP .Net 11 05-27-2005 05:53 PM
Length of Array of Array of Array Tom Perl Misc 3 12-20-2004 05:23 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57