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

Curiosity...

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
2 1399
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jay | last post by:
Hi, I'm a C++="C with classes" kind of guy and was wondering if anyone felt like making the case that STL Vectors are in any way better than my home-brewed, memmove()-heavy dynamic array class...
1
by: bartek | last post by:
Hi, Consider the following implementation of swap() for some class... It looks a little bit like a hells-spawn. Though it should work for every object with continuous memory layout, wouldn't...
3
by: Rolan | last post by:
To those that have been around Access long enough, I'm sure that insight can be shared as to what aspects of computer processing speed improves its performance. Perhaps in some respects even...
2
by: djinni | last post by:
howdy, Can anyone tell me where the function name string is stored when __func__ is used? I read that it is basically like declaring a static const char, but when I compile the following code,...
1
by: Neil Zanella | last post by:
Hello, In C++ AFAIK structure assignment copies every data member element by element. This rule also works with the gcc 3.2.2 C compiler and even works when one of the members is a union as in...
16
by: Stephen Mayes | last post by:
Correct me if I am mistaken. The C standard guarantees that in a C hosted environment we can define main as: int main( int argc, char *argv ). I always assume that 'argc' is the number of...
11
by: Sensei | last post by:
Hi again! I have still curiosity about the reason of some C constructs/keywords... The first is about static functions. What was the reason of restricting a function to be visible just in a...
3
by: Henri.Chinasque | last post by:
Hi all, Just from a pure curiosity standpoint, would it be possible to have an assembly with both c++ and c#? Google searches seem to hint at a "yes" but I'm not so sure. thanks, HC
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.