_z33 wrote:
> > Unless you're writing a compiler this does not matter. Even if an int
> > argument in implicitly used it has no meaning to the programmer.
> > Since void is a well defined type, although an incomplete one, I have
> > doubts that int is used internally. I simply can't see the ra
_z33 wrote:
>I'm clear... but, now wondering why for two days a guy from an R&D
> dept of an MNC is arguing with me, saying that a function with empty
> argument specification implies having implicit "int" type arguments.
> (similar to the implicit assumption of return type of functions to
_z33 wrote:
>I had a wierd doubt today morning. If a function's return type is not
> defined, "C" takes it as returning "int". Now, what does it do when I
> don't specify the arguments of the function. Something like this -
>
>void sampleFunc ()
>{
> /* ... */
>}
>
>
On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
> Steve Graegert wrote:
> > I have modified the code to clarify my thoughts:
> >
> > #include
> >
> > /* prototype */
> > void add(); /* call with arbitrary number of arguments */
> >
> > void add (int a, int b, int c) {
> >
Steve Graegert wrote:
Thou *I think* even the C compiler should have given a
warning. (Note -Wall does not turn on all warnings, just almost all).
try -ansi combined with -pedantic.
I'm using "bloodshed developer cpp" compiler (it uses Mingw port of
GCC as it's compiler)in windows for the
Steve Graegert wrote:
I have modified the code to clarify my thoughts:
#include
/* prototype */
void add(); /* call with arbitrary number of arguments */
void add (int a, int b, int c) {
printf ("inside function: add(%d, %d)\n", a, b);
On 9/9/05, Jarmo <[EMAIL PROTECTED]> wrote:
> There is a diff in how C and C++ sees this.
>
> For C add( ) is an function taking undefined argument(s), so you can
> send it whatever you want. C++ on other hand will see add( ) as add(
> void ), and would complain. To say that add( ) would be equal
On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
> Steve Graegert wrote:
>
> > Unless you're writing a compiler this does not matter. Even if an int
> > argument in implicitly used it has no meaning to the programmer.
> > Since void is a well defined type, although an incomplete one, I have
> > doubts
There is a diff in how C and C++ sees this.
For C add( ) is an function taking undefined argument(s), so you can
send it whatever you want. C++ on other hand will see add( ) as add(
void ), and would complain. To say that add( ) would be equal to add(
int(s) ) is bogus thou.
In real life thi
Steve Graegert wrote:
Unless you're writing a compiler this does not matter. Even if an int
argument in implicitly used it has no meaning to the programmer.
Since void is a well defined type, although an incomplete one, I have
doubts that int is used internally. I simply can't see the ration
On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
> Steve Graegert wrote:
> > On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
> >
> >> I had a wierd doubt today morning. If a function's return type is not
> >>defined, "C" takes it as returning "int". Now, what does it do when I
> >>don't specify the arguments
Steve Graegert wrote:
On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
I had a wierd doubt today morning. If a function's return type is not
defined, "C" takes it as returning "int". Now, what does it do when I
don't specify the arguments of the function. Something like this -
void sampleFunc ()
On 9/9/05, _z33 <[EMAIL PROTECTED]> wrote:
> I had a wierd doubt today morning. If a function's return type is not
> defined, "C" takes it as returning "int". Now, what does it do when I
> don't specify the arguments of the function. Something like this -
>
> void sampleFunc ()
> {
>
13 matches
Mail list logo