Newbie needs help plz

This is a discussion on Newbie needs help plz within the C++ Programming forums, part of the General Programming Boards category; He didn't, but you just did; MSVC. So why asking something if you know the answer? wait... don't answer that. ...

  1. #16
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,436
    He didn't, but you just did; MSVC.

    So why asking something if you know the answer? wait... don't answer that. I know the answer
    The programmers wife tells him: Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #17
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Did I say anything to you siacoshkc, saing that what I wrote was inteded towards you? I just said in general.



    >> If you couldn't make it work, its because you didn't read about it. Like now. If you just read other posts of this thread, you can make it work. And don't use that unsafe method.

    Also, I don't see any '?' for a question

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Quote Originally Posted by twomers
    >> #define AND &&
    >> #define OR ||

    Bad bad bad. That's like saying:

    #define begin {
    #define end }
    blah blah

    then you can do C or C++ in pascal. There's no need to do the above, && and || etc are fine IMO.
    Hardly. Not only are the quoted macros not "bad bad bad", they have a legitimate purpose. For example, what if you have a keyboard that doesn't support the requisite characters? C supports trigraphs for that reason, and C++ supports trigrahs and digrahs. In fact, C blesses the idea with the iso646.h header where the macros aren't much different, and C++ reserves actual keywords such as "and", "or", and "not", for the same purpose.
    My best code is written with the delete key.

  4. #19
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    I didn't think of that. But to be honest, how many keyboards do you know which don't have &'s or |'s or whatever? I was always told that that kind of defining is 'bad bad bad' ...

  5. #20
    The Richness... Richie T's Avatar
    Join Date
    Jan 2006
    Location
    Ireland
    Posts
    469
    How many keyboards do you know that don't have a # on them!!?

    The #define is always good for a little obfuscation
    No No's:
    fflush (stdin); gets (); void main ();


    Goodies:
    Example of fgets (); The FAQ, C/C++ Reference


    My Gear:
    OS - Windows XP
    IDE - MS Visual C++ 2008 Express Edition


    ASCII stupid question, get a stupid ANSI

  6. #21
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >But to be honest, how many keyboards do you know which don't have &'s or |'s or whatever?
    None, but my experience with other keyboard layouts is very minimal.

    >I was always told that that kind of defining is 'bad bad bad' ...
    For the most part it is. If there weren't a standard solution, I would be hesitant to even talk about it unless asked a pointed question.
    My best code is written with the delete key.

  7. #22
    Registered User
    Join Date
    Jan 2006
    Location
    Latvia
    Posts
    102
    AND is legal if you #include <iso646.h>

  8. #23
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    >>AND is legal if you #include <iso646.h>
    That header is the one I pointed to.

    >>Also, I don't see any '?' for a question
    This is my post:
    If you see my and Wraithan answer is the same, its because we send it at the same time. Unfortunately I only solved the problem that OP pointed I didn't mention whole the code.
    Now it seems that OP problem is solved somehow, but I have question: How OP code can ever be compiled with that AND? <<<<THIS IS THE QUESTION MARK
    I remember a header with these defines:

    Code:
    #define AND &&
    #define OR ||
    ...But this header is not included in OPs code.
    Review the thread.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie c programmer need assistance plz...
    By Nexus-ZERO in forum C Programming
    Replies: 17
    Last Post: 12-27-2007, 03:05 PM
  2. im newbie to opengl, help plz
    By NecroFromHell in forum C++ Programming
    Replies: 4
    Last Post: 05-14-2006, 08:24 PM
  3. newbie reading a file..how? plz help
    By iori in forum C Programming
    Replies: 3
    Last Post: 04-09-2003, 03:58 PM
  4. HI .. newbie to the board... need some help plz
    By Arwen27 in forum C Programming
    Replies: 3
    Last Post: 04-28-2002, 07:27 AM
  5. Newbie Source Code question. Hlp Plz?
    By BOOGIEMAN in forum Game Programming
    Replies: 4
    Last Post: 12-14-2001, 03:30 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21