Page 1 of 2 12 LastLast
Results 1 to 12 of 23

Thread: How to use color in c++....?

  1. #1
    MailKing is offline Senior Member+
    Last Online
    19th December 2013 @ 04:05 PM
    Join Date
    17 Aug 2009
    Posts
    400
    Threads
    20
    Credits
    1,030
    Thanked
    19

    Default How to use color in c++....?

    Main C++ mai color use krna chahta hon,
    e.g
    1:cout << "How are you?" << endl;

    2:cout << "What are you doing buddy? " << endl;

    line 1 ko read aur 2 ko green color dayna chahta hon, to kayse
    plz help me...

  2. #2
    knowldge_hunter is offline Senior Member+
    Last Online
    19th February 2010 @ 12:52 AM
    Join Date
    26 Oct 2009
    Posts
    44
    Threads
    4
    Credits
    945
    Thanked: 1

    Default aslmolikum

    yes its good qustion i also wnt to know how can we use color??

  3. #3
    knowldge_hunter is offline Senior Member+
    Last Online
    19th February 2010 @ 12:52 AM
    Join Date
    26 Oct 2009
    Posts
    44
    Threads
    4
    Credits
    945
    Thanked: 1

    Default

    reply plzzzzzzzzzzzzzzz

  4. #4
    knowldge_hunter is offline Senior Member+
    Last Online
    19th February 2010 @ 12:52 AM
    Join Date
    26 Oct 2009
    Posts
    44
    Threads
    4
    Credits
    945
    Thanked: 1

    Default

    reply plz that how can we use color ?

  5. #5
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    There are various methods to do so, jst google it, if u dont like mine or wana mess around with colours etc..Use this method to change colours of text.Here u go guys...

    Code:
    #define black 0
    #define dark_blue 1
    #define green 2
    #define cyan 3
    #define red 4
    #define dark_purple 5
    #define brown 6
    #define gray 7
    #define dark_gray 8
    #define blue 9
    #define neon_green 10
    #define light_blue 11
    #define light_red 12
    #define purple 13
    #define yellow 14
    #define white 15
    
    // function to set color
    
    void color(int color)
    {
       HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
       SetConsoleTextAttribute(hCon,5);
       cout << "Saif";
    }
    oh and remember to add <windows.h>

    agar koi aur question ho to i will be glad to help..

  6. #6
    loinheart's Avatar
    loinheart is offline Senior Member+
    Last Online
    17th July 2010 @ 12:53 PM
    Join Date
    10 Jul 2009
    Age
    34
    Posts
    58
    Threads
    6
    Credits
    945
    Thanked: 1

    Default

    Asallam o aliykum
    bhai jan borlabd c++ main object ko file main kaise write aur read karte hain ?
    main ne reinterpret_cast b use kar liya nh ho raha hai
    please bhai log batado

  7. #7
    MailKing is offline Senior Member+
    Last Online
    19th December 2013 @ 04:05 PM
    Join Date
    17 Aug 2009
    Posts
    400
    Threads
    20
    Credits
    1,030
    Thanked
    19

    Default

    Quote SufyanGujar said: View Post
    There are various methods to do so, jst google it, if u dont like mine or wana mess around with colours etc..Use this method to change colours of text.Here u go guys...

    Code:
    #define black 0
    #define dark_blue 1
    #define green 2
    #define cyan 3
    #define red 4
    #define dark_purple 5
    #define brown 6
    #define gray 7
    #define dark_gray 8
    #define blue 9
    #define neon_green 10
    #define light_blue 11
    #define light_red 12
    #define purple 13
    #define yellow 14
    #define white 15
    
    // function to set color
    
    void color(int color)
    {
       HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
       SetConsoleTextAttribute(hCon,5);
       cout << "Saif";
    }
    oh and remember to add <windows.h>

    agar koi aur question ho to i will be glad to help..
    Thanks dear...

  8. #8
    I A Qureshi's Avatar
    I A Qureshi is offline Senior Member+
    Last Online
    27th January 2011 @ 03:36 PM
    Join Date
    07 Jan 2010
    Location
    Rawalpindi
    Posts
    44
    Threads
    4
    Credits
    960
    Thanked
    0

    Default


    Thanks for information

  9. #9
    junaid789 is offline Junior Member
    Last Online
    6th June 2010 @ 03:15 PM
    Join Date
    15 Feb 2010
    Age
    34
    Posts
    6
    Threads
    1
    Credits
    687
    Thanked
    0

    Default

    Quote SufyanGujar said: View Post
    There are various methods to do so, jst google it, if u dont like mine or wana mess around with colours etc..Use this method to change colours of text.Here u go guys...

    Code:
    #define black 0
    #define dark_blue 1
    #define green 2
    #define cyan 3
    #define red 4
    #define dark_purple 5
    #define brown 6
    #define gray 7
    #define dark_gray 8
    #define blue 9
    #define neon_green 10
    #define light_blue 11
    #define light_red 12
    #define purple 13
    #define yellow 14
    #define white 15
    
    // function to set color
    
    void color(int color)
    {
       HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
       SetConsoleTextAttribute(hCon,5);
       cout << "Saif";
    }
    oh and remember to add <windows.h>

    agar koi aur question ho to i will be glad to help..
    plz type full code and show how this will applay and use

  10. #10
    junaid789 is offline Junior Member
    Last Online
    6th June 2010 @ 03:15 PM
    Join Date
    15 Feb 2010
    Age
    34
    Posts
    6
    Threads
    1
    Credits
    687
    Thanked
    0

    Default see how this use the colour

    plz type full code and show how this use it

  11. #11
    Ganxtr's Avatar
    Ganxtr is offline Advance Member
    Last Online
    5th July 2019 @ 09:15 AM
    Join Date
    15 Nov 2009
    Location
    CRIME CITY
    Posts
    1,740
    Threads
    18
    Credits
    83
    Thanked
    100

    Default


  12. #12
    ikram62's Avatar
    ikram62 is offline Anti-spam
    Last Online
    27th February 2024 @ 03:55 PM
    Join Date
    14 Feb 2010
    Location
    Mardan
    Age
    49
    Gender
    Male
    Posts
    9,234
    Threads
    1149
    Credits
    6,059
    Thanked
    801

    Default

    اچھی کاوش ہے
    جاری رکھو

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: 5th March 2017, 05:49 PM
  2. [color="red] Quantity softwar [/color]
    By Star moon in forum Educational Help
    Replies: 0
    Last Post: 2nd October 2015, 11:05 PM
  3. 4 Color Printing Kay Bajae 3 Color Me Printing Krain
    By Toqeer Sheikh in forum Urdu Tutorials & Designing
    Replies: 66
    Last Post: 21st September 2013, 03:05 PM
  4. Replies: 2
    Last Post: 9th August 2012, 08:27 AM
  5. [COLOR="DarkRed"]PlZ ALERT UFONE FREE GPRS HACKERS[/COLOR]
    By laghari25pk in forum General Mobile Discussion
    Replies: 5
    Last Post: 8th July 2009, 10:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •