News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Help choosing a version of C

Started by asmrixstar, May 03, 2006, 05:01:18 PM

Previous topic - Next topic

asmrixstar

Bit of a wierd question but here goes

Is there a version of c that doesnt require a semicolon at the end of each line?
this seem dumb to me since 90% of command fit on one line forcing u to insert unnecesary characters

I dunno it just seems cumbersome....

Vortex

I am afraid there is no any version of C that doesn't require a semicolon at the end of each line.

asmrixstar


bieber

If you really wanted to, you could write a little preprocessor to insert all the semicolons for you, after checking that a line doesn't end in a {

clive

Quote from: bieber on June 29, 2010, 07:16:57 PM
If you really wanted to, you could write a little preprocessor to insert all the semicolons for you, after checking that a line doesn't end in a {

That would work great with for() and while(), etc


while(1);
{
  puts("Will it get here?");
}
It could be a random act of randomness. Those happen a lot as well.

bieber

Quote from: clive on June 29, 2010, 08:11:48 PM
Quote from: bieber on June 29, 2010, 07:16:57 PM
If you really wanted to, you could write a little preprocessor to insert all the semicolons for you, after checking that a line doesn't end in a {

That would work great with for() and while(), etc


while(1);
{
  puts("Will it get here?");
}


Assuming you put the { on the same line as the loop declaration ;)  Of course it would be a lot more complicated if you wanted to do it right...you'd need to check for things like opening loop bodies, figure out whether you're looking at a function prototype or a declaration, etc.  It's doable, but obviously the sane solution is to just type your semicolons

jj2007

Quote from: bieber on June 29, 2010, 08:19:36 PM
the sane solution is to just type your semicolons

The sane solution is to use assembler instead of C. But I see that you don't have a high opinion of assembly: "Robert Bieber was once a Windows developer, hacking out code in Assembly. Now, he's a devout GNU/Linux user, and champion of the Free Software cause"  :wink

By the way, you revived a four year old thread...

bieber

Quote from: jj2007 on June 29, 2010, 08:26:24 PM
The sane solution is to use assembler instead of C. But I see that you don't have a high opinion of assembly: "Robert Bieber was once a Windows developer, hacking out code in Assembly. Now, he's a devout GNU/Linux user, and champion of the Free Software cause"  :wink
Don't be silly, I think Assembly is a lot of fun.  I do most of my work in higher level languages nowadays, but that doesn't mean I don't know my way around an assembler.  Regardless, the topic of the thread was C syntax, and obviously the OP had some reason for choosing C over assembly.  Perhaps they need to write portable code?  C vs. Assembly is completely off-topic, as is you randomly digging up some silly old project of mine...

Quote
By the way, you revived a four year old thread...
Woops, I didn't realize just how little goes on in this subforum...I never thought there'd be a years-old thread on the front-page.  I'll keep an eye out in the future.

And hey, you dug up a four year old bio (where did you find that, anyways?), so I guess we're even

Twister

I'm not sure if I am helping or not, but when using a language, it's best to stick the specifications for good source code. I'm not sure if any of you are understanding me. So yeah, there are my two cents.

frktons

Quote from: Radio Ga Ga on July 30, 2010, 08:27:50 AM
I'm not sure if I am helping or not, but when using a language, it's best to stick the specifications for good source code. I'm not sure if any of you are understanding me. So yeah, there are my two cents.

:U
Mind is like a parachute. You know what to do in order to use it :-)

drizz

#define begin {
#define end }
#define procedure void

procedure start()
begin

end;

The truth cannot be learned ... it can only be recognized.

jj2007


TmX

Quote from: drizz on July 30, 2010, 12:52:14 PM
#define begin {
#define end }
#define procedure void

procedure start()
begin

end;



yep... that's pascal  :bg

frktons

Quote from: drizz on July 30, 2010, 12:52:14 PM
#define begin {
#define end }
#define procedure void

procedure start()
begin

end;



For a while I was thinking about using these #defines to avoid
the nasty curley brackets I can't find on my keyboard, but eventually
I was back to ALT+123/125 to get them.  :P
Mind is like a parachute. You know what to do in order to use it :-)

dedndave

on this keyboard, they are shifted versions of the square bracket keys
but - you can always use copy/paste instead of a funky key-sequence
you might be able to use some otherwise not-often-used characters in their place (like @ and Z or something)
then, do a find-replace to make them braces