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
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
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
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.
> 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; }
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?
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
Walk before you run, and crawl before you walk. Check out the tutorials on the site.
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.
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;}
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.