473,386 Members | 1,819 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,386 software developers and data experts.

What is the use of keyword __cdel in function signature.

Hi all,

I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
Apr 6 '06 #1
5 3096
"code break" <pk*****@gmail.com> writes:
I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
.
.
}

can any one tell me about the use of keyword __cdel in above function
defintion..


There is no __cdecl keyword in standard C. It's an extension
implemented by your compiler. (It probably specifies something about
the calling convention, something that the compiler should normally be
able to decide for itself.)

For more information, consult the documentation for your compiler.
Failing that, a Google search for "__cdecl" gets 157,000 hits.
Failing that, try a newsgroup appropriate to your compiler and/or
operating system.

--
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.
Apr 6 '06 #2

code break wrote:
Hi all,

I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
.
.
}

can any one tell me about the use of keyword __cdel in above function
defintion..

it help lot for me .


__cdecl is a C/C++ function / method calling convention. It is also a
default calling behavior for C functions. It allows for variable
arguments unlike __stdcall calling convention. The arguments are passed
right to left. It is the responsiblity of calling function to do stack
cleanup.

You would probably not need to use __cdecl since its the default unless
you have specified __stdcall in compiler options.

For a much better explanantion take help from google.

Apr 6 '06 #3

Jaspreet wrote:
code break wrote:
Hi all,

I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
.
.
}

can any one tell me about the use of keyword __cdel in above function
defintion..

it help lot for me .


__cdecl is a C/C++ function / method calling convention. It is also a
default calling behavior for C functions. It allows for variable
arguments unlike __stdcall calling convention. The arguments are passed
right to left. It is the responsiblity of calling function to do stack
cleanup.

You would probably not need to use __cdecl since its the default unless
you have specified __stdcall in compiler options.

For a much better explanantion take help from google.


Forgot to add that the above explanation is from Microsoft VC++ point
of view.

Apr 6 '06 #4
Jaspreet wrote:
Jaspreet wrote:
code break wrote:
Hi all,

I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
.
.
}

can any one tell me about the use of keyword __cdel in above function
defintion..

it help lot for me .


__cdecl is a C/C++ function / method calling convention. It is also a
default calling behavior for C functions. It allows for variable
arguments unlike __stdcall calling convention. The arguments are passed
right to left. It is the responsiblity of calling function to do stack
cleanup.

You would probably not need to use __cdecl since its the default unless
you have specified __stdcall in compiler options.

For a much better explanantion take help from google.

Forgot to add that the above explanation is from Microsoft VC++ point
of view.


Nobody seems to notice that the OP is asking about '__cdel', not '__cdecl'.

Bas
Apr 6 '06 #5

Bas Wassink wrote:
Jaspreet wrote:
Jaspreet wrote:
code break wrote:

Hi all,

I came across some unexpected funtion definition as follows

int __cdel function_name(int arg1,int arg2)
{
statements ;
.
.
}

can any one tell me about the use of keyword __cdel in above function
defintion..

it help lot for me .

__cdecl is a C/C++ function / method calling convention. It is also a
default calling behavior for C functions. It allows for variable
arguments unlike __stdcall calling convention. The arguments are passed
right to left. It is the responsiblity of calling function to do stack
cleanup.

You would probably not need to use __cdecl since its the default unless
you have specified __stdcall in compiler options.

For a much better explanantion take help from google.

Forgot to add that the above explanation is from Microsoft VC++ point
of view.


Nobody seems to notice that the OP is asking about '__cdel', not '__cdecl'.

Bas


Silly me. Thanks for pointing that out. Not only me even Keith also got
it wrong. After all to err is to human. :)

Apr 7 '06 #6

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

Similar topics

14
by: lawrence | last post by:
To call I would do something like: $headline = McSelectJustOneField::callDatastore("cbHeadline"); Is this the correct use of the static keyword, to implement a Singleton design?
7
by: Peter Otten | last post by:
I'm sure they have been mentioned somewhere but here are some more advantages of a decorator keyword (I use "transform"): - The docstring can be moved to the top of the decorator suite. - Simple...
19
by: ARK | last post by:
I am writing a search program in ASP(VBScript). The user can enter keywords and press submit. The user can separate the keywords by spaces and/or commas and key words may contain plain words,...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
4
by: aling | last post by:
What's the rule of default argument of function in C++? I found that the default argument of function could not necessary be a constant value. Is it true? Previously I thought that the default...
8
by: Dot net work | last post by:
I need VB.NET's "shadows" functionality inside a C# project. I tried the "new" keyword, but it didn't seem to work, because my particular function does in fact differ in signature to the function...
9
by: Chazza | last post by:
I would like to override a method from an inherited class, but the new method has a different signature to the inherited class. Example: class A { private void Init() { // code } } class B...
1
by: Jozsef Bekes | last post by:
Hi All, I need to offer scripting possibilities in my app, and have to use MSSCriptControl for some reasons. I would like to use the feature that's called variable number of arguments, that is...
50
by: LaundroMat | last post by:
Suppose I have this function: def f(var=1): return var*2 What value do I have to pass to f() if I want it to evaluate var to 1? I know that f() will return 2, but what if I absolutely want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.