473,800 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2856
"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*********@gm ail.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_Keit h) 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 misunderstandin gs. 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_poit ner_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*********@gm ail.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_Keit h) 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.c om, 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.n et>,
Chuck F. <cb********@mai neline.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.in teraccess.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.in teraccess.com> wrote: [the usual]

[snip]

Please don't feed the troll.

--
Keith Thompson (The_Other_Keit h) 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

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

Similar topics

58
10188
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 code... TCHAR myArray; DoStuff(myArray);
4
38258
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 global and any functions should be able to access it. I have been having trouble getting this to work. In the 1st of the 2 examples below I initialize the Array "initArray" with 4 form text fields. When I try to use initArray inside either of...
32
2169
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
338
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 looking for something like this: array = {func1(a, b, c), func2(b, c), func3(a), func4(a,b,c,d)....} If I need to call a function I want to be able to call the function by writing something like array Is that or anything close to that format...
7
5643
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 strings of any lengths into an array of pointers to char type variable. my problem is: given the declaration
21
3226
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 column. Once the array elements are split, what is the best way to sort them? Thank you. //populate data object with data from xml file. //Data is a comma delimited list of values var jsData = new Array(); jsData = {lib: "#field...
9
2111
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 size of array I need at run time without using too much memory or going over the allotted size if I choose to use this object for a different game. One idea I have is to create space * spaces = new space; then have all my accessors just convert...
14
20415
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 passed also. I understand that this way of passing the array is by value and if the prototype is declared as foo(int *), it is by reference in which case the value if modified in the function will get reflected in the main function as well. I dont...
5
3654
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 10 member functions. Can switch be replaced to member function pointer array? Please provide me an example of source code to show smart pointer inside class. Thanks....
3
4850
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 pointers (delegates). I assume I need to use the array< T keyword to allocate an array of delegates, and then initialize the array by setting each array element to the pointers (handles) of the functions I'll be invoking. I've been trying to...
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.