Thread: why does this give an error?

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    28

    why does this give an error?

    Why does this give an error?

    the error is:

    "Conflicting type modifier"

    Code:
    byte far	far_array[3] = { 'H', 'i', 0 };

  2. #2
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    what is byte? and what is far?

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    far is for "far pointers". In other words, he has an old ass 16bit compiler, or is trying to use code from a book designed for an old ass compiler. I'd just suggest what I always suggest, get a real compiler.

    But I believe what it's actually saying is not to use "far" with your array, since "far" is used with pointers.

    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    What scope is this in? If it's not in file scope then it's a local variable on the stack (hence, near data), so declaring it as far is contradictory.
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    28
    thanks, that solved one problem.

    it was of local scope

  6. #6
    ---
    Join Date
    May 2004
    Posts
    1,379
    just out of curiosity, what compiler are you using?

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >what compiler are you using?
    Probably Turbo C v.old.
    My best code is written with the delete key.

  8. #8
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Quote Originally Posted by Prelude
    >what compiler are you using?
    Probably Turbo C v.old.
    quoted for truth, and funny.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  3. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM