473,325 Members | 2,860 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,325 software developers and data experts.

can a function name be an identifier?

iam wondering if a function name,say sum,could serve as an identifier?
thanks.

Jan 20 '06 #1
9 1480
no************@hotmail.com wrote:
iam wondering if a function name,say sum,could serve as an identifier?
thanks.


Function names _are_ idnetifiers.

If you meant, can you reuse a function name as a variable name,
the simple answer is no, at least not in the same scope.

There are ways to achieve this though, but I'd strongly advise
against them.

Cheers

Vladimir

--
My e-mail address is real, and I read it.
Jan 20 '06 #2
no************@hotmail.com writes:
iam wondering if a function name,say sum,could serve as an identifier?


A function name has to be an identifier.

What are you really trying to ask?

--
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.
Jan 20 '06 #3
no************@hotmail.com wrote:
iam wondering if a function name,say sum,could serve as an identifier?
thanks.


No if you are planning to use a function name as another identifier. I
faintly remember reading something of reusing it but my question would
be why ? Have we run out of identifier names ?

Jan 20 '06 #4
Can a variable's name be identical with a function's?

Jan 20 '06 #5
iam just curious about it:)

Jan 20 '06 #6
iam just curious about it:)

Jan 20 '06 #7
no************@hotmail.com wrote:
Can a variable's name be identical with a function's?


Please quote the context you're replying to.

Also, please phrase your questions more carefully, since the
answer to the above question is:

Yes /and/ No, depending on what exactly you want to achieve.

Cheers

Vladimir
--
My e-mail address is real, and I read it.
Jan 20 '06 #8
I can not express how grateful I am!
Both to your generous assistance and to your patience:)
And I am leaving.
see ya.

Jan 20 '06 #9
no************@hotmail.com wrote:
iam wondering if a function name,say sum,could serve as an identifier?


As others have said: It is an identifier.

The namespace and scope rules of C make the following a
standard conforming C program; I used the identifier a
whenever I knew it was allowed, otherwise I changed to b
(I may have missed an opportunity for "a"):

,-- Do not do this at home ;-) --

typedef struct a { union b { int a; } a; } a;

void b (int a);

int main (void)
{
a a;
struct a { char a;} b;
a: {
long a;
b: ;
}
return 0;
}

void b (int a)
{
int b;
a: ;
}

´---

Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Jan 20 '06 #10

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

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
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...
9
by: drhowarddrfinedrhoward | last post by:
I see a number of pages with functions like MM_somefunction(). Where does the MM_ come from? I don't see it in any books I'm studying.
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
5
by: Cancerbero | last post by:
Hi (first, excuse me for my bad english) As I know, the semantics for typedef is: typedef A B; I think this makes B a synonym of A, where A is an existing data type. Is that right? Based...
42
by: baumann | last post by:
hi all, typedef int (*pfunc)(int , int); pfunc a_func; i know it's ok, but how can define a_func without typedef statement? thanks .
17
by: Matt Kruse | last post by:
Perl's map() function is a powerful shortcut to accomplish many "loop over an array and do X" operations. Below is a quick hack to simulate similar functionality. I've used it a few times and find...
5
by: mk | last post by:
Greetings all - im new to this newsgroup so pls dont flame me :p I need some help! Please view the html below in a browser. Or goto this url -http://firebrain.co.uk/java-problem.htm (Assuming...
1
by: INeedADip | last post by:
What is the difference between: function setupGrid( param ){......} and setupGrid = function( param ){......} Are there any advantages to doing one over the other?
7
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.