Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C Expressions

Name: Anonymous 2007-07-23 6:35 ID:S8qiyQdD

Can i do this in C?
int i = (1, 2); /* i gets the value of the last evaluated expression - that is 2 */
Is it allowed? my compiler does not complain.

The reason i am asking this is because i want to write a getopt in the form of a macro using #define.
In order for this to work like getopt(3) it needs to be maed of exprzionz

so yeah, is it a good idea to write a macro'd getopt()?
also, what about i = (1, 2)?

Name: Anonymous 2007-07-23 6:40 ID:Heaven

What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.

Name: Anonymous 2007-07-23 7:24 ID:Heaven

>>2
can you explain?

Name: Anonymous 2007-07-23 7:44 ID:p+2PEg3j

What's the point?

Name: Anonymous 2007-07-23 8:07 ID:Heaven

Parsing command-line arguments is never the difficult part of a program. Just use your OS's getopt, and think about what problem you're solving instead.

Name: Anonymous 2007-07-23 8:16 ID:S8qiyQdD

>>5
What about i = (1, 2)?
Also, i know it's not the difficult part of the program, i just want to write a macroed getopt, i don't care if it's the difficult or the easy part..
So my questions are
1) is i = (1, 2) correct?
2) a #define'd getopt would be a good or a bad idea?

Name: Anonymous 2007-07-23 8:18 ID:dRhApqWJ

The `,' operator takes two arguments and returns the second.

In Haskell it takes two arguments and returns a pair.

Name: Anonymous 2007-07-23 8:23 ID:cYeVtn0z

>>5
Reinventing wheels is more fun than solving real problems.

Name: Anonymous 2007-07-23 9:09 ID:S8qiyQdD

>>8
Depends why you reinvent it.
If its to make it better OR to learn, then its for a good purpose

So can i get a seriose reply? :/

Name: Anonymous 2007-07-23 9:15 ID:Heaven

>>9
Just because you can stick your dick in a mouse trap, doesn't mean it is a good idea.

Name: Anonymous 2007-07-23 9:34 ID:7D7ucmXf

It seemed like it at the time.

Name: Anonymous 2007-07-23 9:37 ID:xI89lCX1

Name: Anonymous 2007-07-23 12:44 ID:Heaven

so yeah, is it a good idea to write a macro'd getopt()?
I doubt anyone here has done it. Go ahead and try it if you want and let us know how it turns out.

Name: Anonymous 2007-07-23 15:54 ID:U2yAkdbB

>>85
stfu perl

Name: Anonymous 2007-07-23 16:55 ID:RJVh7ML/

What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.What the fucking fuck. No, to all of your questions. Saging thread due to shitty C newb and code.

Name: Anonymous 2007-07-23 19:39 ID:Heaven

>>15 you fail at sage

Name: Anonymous 2009-08-03 8:18

sage

Name: Anonymous 2010-11-25 5:55

Name: Anonymous 2010-12-17 1:30

Xarn is a bad boyfriend

Don't change these.
Name: Email:
Entire Thread Thread List