By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,657 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,657 IT Pros & Developers. It's quick & easy.

Curiosity...

P: n/a
Reading some code today I saw this:

static int
CreateCompress(cinfo, version, size)
j_compress_ptr cinfo;
int version;
size_t size;
{
jpeg_create_compress(cinfo);
return TCL_OK;
}

Is this 100% equivalent to:

static int CreateCompress(j_compress_ptr cinfo, int version, size_t size) {
jpeg_create_compress(cinfo);
return TCL_OK;
}

Have you ever seen that kind of syntax before? This was my first time...

Francesco Gallarotti
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 02 Dec 2003 04:58:12 GMT, "Francesco Gallarotti"
<ga********@hotmail.com> wrote in comp.lang.c++:
Reading some code today I saw this:

static int
CreateCompress(cinfo, version, size)
j_compress_ptr cinfo;
int version;
size_t size;
{
jpeg_create_compress(cinfo);
return TCL_OK;
}
This code is not C++, it is pre-standard C. No C++ compiler should
accept it.
Is this 100% equivalent to:

static int CreateCompress(j_compress_ptr cinfo, int version, size_t size) {
jpeg_create_compress(cinfo);
return TCL_OK;
}
In C, the operation of the function is the same. But it is not 100%
equivalent in that the first form does not create a prototype.

Have you ever seen that kind of syntax before? This was my first time...

Francesco Gallarotti


Sure, see the C Programming Language, first edition, not the second.
And most books about C written prior to 1990, and sadly too many
written afterwards. But it's nothing to do with C++.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq>

Jul 22 '05 #2

P: n/a
> This code is not C++, it is pre-standard C.
[...] But it's nothing to do with C++.


Sorry I didn't know it otherwise I wouldn't post it on this NG... Thanks for
pointing it out.
It surprises me even more that the snippet of code I post was part of a file
named .cpp.

Thanks,

--Francesco
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.