Turning off ANSI in compiler

This is a discussion on Turning off ANSI in compiler within the C Programming forums, part of the General Programming Boards category; Does anyone know how to turn off ANSI compatibility in Microsoft Visual C++ 6.0 Professional Edition. I'm trying to use ...

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    53

    Turning off ANSI in compiler

    Does anyone know how to turn off ANSI compatibility in Microsoft Visual C++ 6.0 Professional Edition. I'm trying to use



    fprintf(stdprn,"blah blah");

    but my c programming book said ANSI needed to be turned off on the compiler for stdprn to work. Can anyone direct me on how to do it ?

  2. #2
    Registered User
    Join Date
    Feb 2004
    Posts
    46
    Compilers will generally use extensions by default, relying on a switch to engage pure ANSI conformance. I believe that the switch in Visual Studio is /Za to enable and /Ze to disable. However, if Visual Studio doesn't define stdprn (and I don't think it does) then enabling extensions will not make your code compile.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    53
    Where do I type /Za in at? Do i just press all three at the same time like ctrl>alt>delete??

    How can I get the stream stdprn to compile then?

  4. #4
    Registered User
    Join Date
    Feb 2004
    Posts
    46
    Since you probably aren't compiling from the command line, you'll probably find the command line settings under Projects->Settings. As I said, I don't think that Visual Studio defines the stdprn stream, so you'll have to do it yourself by opening a FILE* as "LPT1", "LPT1:", "PRN", or some other variation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Have you ever written a compiler?
    By ammar in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 12-27-2004, 07:10 AM
  2. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 07:13 AM
  3. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-01-2004, 08:39 PM
  4. OpenScript2.0 Compiler
    By jverkoey in forum C++ Programming
    Replies: 3
    Last Post: 10-30-2003, 01:52 PM
  5. Compiler Design... Anyone That Can Help!
    By ComputerNerd888 in forum C++ Programming
    Replies: 3
    Last Post: 09-27-2003, 10:48 AM

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