What kind of this language?

Discussion in 'Programmer's Corner' started by asdf arfw, Oct 25, 2017.

  1. asdf arfw

    Thread Starter Member

    Sep 9, 2017
    43
    0
    I'm learning about graphic functions in C or C++. At first I tried to use gotoxy() function but it didn't work so I google it and
    found the answer. It because that function is an old function and my compiler doesn't have it so they recommend me to use
    SetConsole functions instead but then another question come into my head. What kind of language is this? I never saw it before.
    Does anyone know? just give me a topic and I'll read it by myself.

    upload_2017-10-25_15-2-3.png

    P.S. my english isn't good because it's my 2nd language. Hope you understand me btw.
     
    Last edited: Oct 25, 2017
  2. bertus

    Administrator

    Apr 5, 2008
    19,689
    4,055
    Hello,

    The gotoxy is a function defined on line 4 with the description from line 13 and on .

    Bertus
     
  3. asdf arfw

    Thread Starter Member

    Sep 9, 2017
    43
    0
    I mean..
    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN); <---- what is this?
    is it C language?
     
  4. bertus

    Administrator

    Apr 5, 2008
    19,689
    4,055
  5. Papabravo

    Expert

    Feb 24, 2006
    12,190
    2,681
    Yes, and it is specific to Windows.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    18,886
    6,050
    gotoxy(int x, int y) is a text console library function to position the text cursor to a particular location on the screen given by line-y at position-x.
     
  7. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    4,200
    6,278
    Yes, it is C language calling two library functions with predefined constants.

    Interestingly, the file itself indicates C++, but the code is standard C.
     
  8. WBahn

    Moderator

    Mar 31, 2012
    24,344
    7,602
    While the language is C/C++, I think the issue you are trying to get at is that the graphics functions are NOT part of the language. C doesn't have much in the way of intrinsic I/O capability and those are all text console and file oriented. So if you want to do graphics, you have to use a library of routines (or write your own) to do it for you and how you do graphics is SO different from machine to machine that using those libraries is pretty much guaranteed to make your code non-portable.

    The old conio.h was a non-standard library for doing more sophisticated console I/O tasks, such as moving the cursor around or detecting individual keystrokes. The Windows.h library is conceptually similar, except that it focusses on using Windows O/S capabilities so that the code will compile and run on machines using Windows.
     
    xox likes this.
  9. meinierout

    New Member

    Oct 29, 2017
    3
    1
    It's C language
     
  10. cdh20

    New Member

    Dec 4, 2013
    1
    0
    C from the use of the conio.h, C++ in all other respects. The file is saved as .cpp also.
     
Loading...