Re: is order urgent doubt



Keith Thompson wrote:

new to c <non@xxxxxxxxxxxx> writes:
I write the 2 codes

int i;
i = sizeof(long int);
printf("%i", i);

i = sizeof(int long);
printf("%i", i);

and the first code and second code print 4.

Right. It won't necessarily be 4 on all systems, but both are
equivalent.

However, "int long" is very non-idiomatic. The compiler can handle it
with no problem, but human readers are going to stumble over it.

(Please ignore the long flame war that will now begin claiming that
anyone who knows C should be able to read "int long" without any
trouble. The fact that the C standard allows variations in the order
of the keywords is fairly obscure; a member of the standard committee
recently posted here saying he didn't even know about it.)

I write another 2 codes

i = sizeof(double int);
printf("%i", i);

i = sizeof(int double);
printf("%i", i);

and the first code print 4 and the second code print 8.

That's surprising. Your compiler should have rejected it, or at least
warned you about it. Are you sure that's *exactly* what you wrote?


He warn "multiple use of int" on first code and "multiple use of double"
on second code but I think is bogus......only one int in first code and
only one double in second code.

I write big international program and need double integer. Why size is
different when other order?

.



Relevant Pages

  • Re: is order urgent doubt
    ... i = sizeof(double int); ... and the first code print 4 and the second code print 8. ...
    (comp.lang.c)
  • Re: CStdioFile - Cant read what I have just written
    ... It's hard to know what's happening just from the information you provided but if I was having this issue on my machine, I'd start by tracing through the first code to ensure everything runs correctly return true, what is your resulting filename). ... And, if that looked okay, I'd then trace through the second code and see what part of that is not working. ... I have a program that uses a text file for configuration. ... configuration is written to a text file using CStdioFile, ...
    (microsoft.public.vc.mfc)
  • Re: is order urgent doubt
    ... i = sizeof(long int); ... and the first code print 4 and the second code print 8. ...
    (comp.lang.c)
  • How to use file I/o codes with forms and controls codes
    ... I tried to include the first code inside the handle function in the second ... But if I put the first code inside the handler function ... of the second code, then, when I click the "IN" button, I would not get what ... if (mark == '-') ...
    (microsoft.public.dotnet.framework.clr)
  • Using regular code inside handler function
    ... I tried to include the first code inside the handle function in the second ... But if I put the first code inside the handler function ... of the second code, then, when I click the "IN" button, I would not get what ... if (mark == '-') ...
    (microsoft.public.dotnet.languages.vc)