Berkeley CSUA MOTD:Entry 12260
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/09 [General] UID:1000 Activity:popular
7/9     

2003/8/29-2004/2/14 [Computer/SW/Languages/C_Cplusplus] UID:12260 Activity:nil
2/13    Where can I get c macro specifications? What keywords to look in
        google?
        \_ You might also want to find a good book on the specification of
           English, so you don't have to look like an ignorant tool asking
           a simple C question.
        \_ what do you want to know?  There's the C language spec that you
           can buy from ANSI.  You can ask on the comp.lang.c FAQ.  You can
           buy K&R.  Or you can see:
           http://www.lns.cornell.edu/public/COMP/info/egcs/cpp/cpp_toc.html
           \_ you can also get a cheap copy of the standard by buying the now
              out-of-print book "annotated c standard" or something like that,
              by herbert schildt. just read the left pages and ignore all the
              crap he spews on the right pages. how you find used copies of
              books is up to you.
2025/07/09 [General] UID:1000 Activity:popular
7/9     

You may also be interested in these entries...
2005/4/29-5/1 [Computer/SW/Languages/Perl] UID:37411 Activity:moderate
4/29    I need help getting information off a web site.  A page presents
        information about an item in locations spread througout the page.
        Each page presents information about one item. What is a quick and
        easy way to go through several pages, capture all the information
        related to each item, and put them into a spreadsheet with a unique
        index?  I think this might be possible by scraping the screen, but how
	...
2004/11/5-7 [Computer/SW/Languages/C_Cplusplus] UID:34697 Activity:high
11/5    In C, why is the "offsetof" macro defined to be of type size_t but not
        ptrdiff_t?  Thx.
        \_ Probably because ptrdiff_t is signed and size_t isn't.
           \_ How does being signed make ptrdiff_t less portable?
              \_ Imagine a 16-bit C implementation, where int is 16 bits, long
                 is 32 bits, and the maximum object size is 64k - 1.  size_t
	...
2004/8/30-31 [Computer/SW/Languages/C_Cplusplus] UID:33228 Activity:high
8/30    Ok this is pretty basic but... is there a way to "escape" text to
        avoid it being substituted by C preprocessor macro expansion?
        \_ Wouldn't that functionality make C preprocessing as powerful as
           lisp's quasiquote/escape? -- ilyas
           \_ Squish!  Isn't it illegal to talk about lisp on the motd?!
        \_ In general no.
	...
2004/8/18-19 [Computer/SW/Languages/C_Cplusplus] UID:32995 Activity:very high
8/18    Doesn't math.h define min() and max() functions?  What should I include
        to get them?  I'd rather not do the (a < b) ? a : b thing.  Thx
        \_ No.  Many programmers define it as a new macro.  Don't know what
           gcc people do, offhand.
        \_ OS X has fmin(3)/fmax(3) which conform to ISO/IEC 9899:1999(E).
           Linux might have these too.
	...
2004/7/13-14 [Computer/SW/Languages/C_Cplusplus] UID:32265 Activity:high
7/12    Someone please explain the following?
        ((size_t )& ((SomeVar *)0)->Field);
        \_ It's a hideous abuse of C++ syntax and results in undefined
           behavior.  It appears to be an attempt to find out the offset of the
           member "Field" in the class/struct type SomeVar.  Ow, ow ow.
           \_ This is actually not undefined, in C or C++.  It is hideous,
	...
2004/7/5 [Computer/SW/Languages/Perl] UID:31164 Activity:high
7/4     Is there something like a macro in Perl?  Couldn't find any in
        the Camel book.
        \_ If you truly need macros in Perl, you probably want AUTOLOAD.
           Of course, if you truly need macros, Perl is the wrong language for
           what you are doing.  -- ilyas
        \_ I don't know perl, but don't almost all interpreted languages have
	...
2003/11/26-27 [Recreation/Dating, Computer/SW/OS/FreeBSD] UID:11228 Activity:kinda low 88%like:29671
11/26   what preprocessor macro is defind on FreeBSD so that I can write
        conditional code only for FreeBSD? i am using gcc...
        What about solaris? Thanks.
http://www.chnlove.com
http://www.chnlove.com/my/profile.php?womanid=GZB271199
http://www.chnlove.com/my/profile.php?womanid=GZB271195
	...
2003/11/26-27 [Computer/SW/OS/FreeBSD] UID:29671 Activity:nil 88%like:11228
11/26   what preprocessor macro is defind on FreeBSD so that I can write
        conditional code only for FreeBSD? i am using gcc...
        What about solaris? Thanks.
        \_ You can use __FreeBSD__ and __sun to tell the difference between
           FreeBSD and Solaris; you can also use __i386 and __sparc if you
           want to know the CPU type.  (These all work with Sun's C compiler
	...
2003/8/9-11 [Computer/HW/CPU] UID:29294 Activity:moderate
8/10    I just build a AMD2500+ computer and overall I'm pretty happy with
        it. However it seems to output a lot more heat than my P4. Is this
        normal?
        \_ yes AMD cpus consume more power and run hotter
        \_ I hope you're not settling for a stock fan, and you have at least
           2-3 case fans.
	...
2002/12/5 [Computer/SW/Apps] UID:26711 Activity:nil
12/4    M$ Excel qn: I have a column of 10000 numbers.  Is there any easy way
        to create another column of 1000 numbers where each number is the sum
        (or average) of the corresponding 10 numbers in the first column?  Thx.
        \_ should be do-able with the Fill-Down menuu item.
        \_ what exactly do you mean by corresponding 10 numbers?
        \_ he means you have column A which has "1,2,3,4,5,6,7,8,9,10", and
	...
2001/4/26-27 [Computer/SW/Languages/C_Cplusplus] UID:21109 Activity:high
4/26    What are some good reasons to use C fptr over regular method calls?
        \_ Data directed programming allows you to do function calls
           in constant time. Of course, many modern compilers will
           take switch/case statements and implement them in constant
           time.  Look at examples of C function pointers and you can
           see why they're used.
	...
Cache (3179 bytes)
www.lns.cornell.edu/public/COMP/info/egcs/cpp/cpp_toc.html
The C Preprocessor - Table of Contents The C Preprocessor Last revised March 1997 for GCC version 2 Richard M Stallman The C Preprocessor The C preprocessor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation. It is called a macro processor because it allows you to define macros , which are brief abbreviations for longer constructs. The C preprocessor provides four separate facilities that you can use as you see fit: Inclusion of header files. These are files of declarations that can be substituted into your program. Macro expansion. You can define macros , which are abbreviations for arbitrary fragments of C code, and then the C preprocessor will replace the macros with their definitions throughout the program. Conditional compilation. Using special preprocessing directives, you can include or exclude parts of the program according to various conditions. Line control. If you use a program to combine or rearrange source files into an intermediate file which is then compiled, you can use line control to inform the compiler of where each source line originally came from. C preprocessors vary in some details. This manual discusses the GNU C preprocessor, the C Compatible Compiler Preprocessor. The GNU C preprocessor provides a superset of the features of ANSI Standard C ANSI Standard C requires the rejection of many harmless constructs commonly used by todays C programs. Such incompatibility would be inconvenient for users, so the GNU C preprocessor is configured to accept these constructs by default. Strictly speaking, to get ANSI Standard C, you must use the options -trigraphs , -undef and -pedantic , but in practice the consequences of having strict ANSI Standard C make it undesirable to do this. See section Invoking the C Preprocessor. The C preprocessor is designed for C-like languages; C For example, the C preprocessor sometimes outputs extra white space to avoid inadvertent C token concatenation, and this may cause problems with other languages. The C Preprocessor Transformations Made Globally Preprocessing Directives Header Files Uses of Header Files The include Directive How include Works Once-Only Include Files Inheritance and Header Files Macros Simple Macros Macros with Arguments Predefined Macros Standard Predefined Macros Nonstandard Predefined Macros Stringification Concatenation Undefining Macros Redefining Macros Pitfalls and Subtleties of Macros Improperly Nested Constructs Unintended Grouping of Arithmetic Swallowing the Semicolon Duplication of Side Effects Self-Referential Macros Separate Expansion of Macro Arguments Cascaded Use of Macros Newlines in Macro Arguments Conditionals Why Conditionals are Used Syntax of Conditionals The if Directive The else Directive The elif Directive Keeping Deleted Code for Future Reference Conditionals and Macros Assertions The error and warning Directives Combining Source Files Miscellaneous Preprocessing Directives C Preprocessor Output Invoking the C Preprocessor Concept Index Index of Directives, Macros and Options This document was generated on 19 July 1998 using the texi2html translator version 151a.