Thread: How do I title my Program?

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    3

    Post How do I title my Program?

    Compiler: Dev-Cpp

    Question: How do I title my program? By title, I mean change the text in the blue bar at the top of every program to something like "Example" instead of it being the path file for the application.

    Thanks in advance,

    GS

  2. #2
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Platform specific.
    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

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    3
    I'm new to the forums and C++, so I'm not quite sure what you're talking about...

    If you're talking about what platform this is for it's just a simple beginner's program I want to be titled when I run on my laptop.

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    > Platform specific.
    Exactly.
    What OS do you use? If it's windows, the API is the answer.
    Code:
    #include <windows.h>
    #include <cstdlib>
    #include <iostream>
    
    int main()
    {
      if( !SetConsoleTitle("Example Console 1.0") )
      {
        std::cerr << "SetConsoleTitle error: " << GetLastError() << "\n";
        std::exit(EXIT_SUCCESS);
      }
      std::cin.get();
      return 0;
    }

  5. #5
    Registered User
    Join Date
    Aug 2006
    Posts
    3
    I'm new to C++, so I may be wrong, but aren't .h files for C programming, not C++?

    Anyways, I'm using std and I declared that under the includes so I'd just remove std::, correct?

  6. #6
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Don't bother yourself with these things, take a good C++ book and go on with it.
    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

  7. #7
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    Walk before you run, and crawl before you walk. Check out the tutorials on the site.

  8. #8
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    You could use system("title X"), where X is the title of your game window. It's a very bigginer way to do it because the system() function is inefficent.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  9. #9
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Platform specific. As stated earlier. This title-changing thing is not C++. You can do it from C++, but it is not C++. You have to rely on the platform (eg. operating systems, drivers etc) to do it, and different computers may well have different platforms!

    You have a long way to go. You may learn 32-bit API programming at some point of your programming career. That's when you can change the title, clear the screen etc etc and have non-standard-C++ fun.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    There are heaps of tutorials/articles on how to title your console window. Just please show some effort and actually do a search on google before posting your question.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 10:58 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM