Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Ah, that makes sense about GTK. I'll probably have to check it out one day to see how that works.
wow

is System() like lower level than like cout and cin?
I'll have to find documentation on conio. It seems useful. Is there a C++ include file that allows GUI programming?
something1990 wrote:
I'll have to find documentation on conio.


http://poli.cs.vsb.cz/c/help/conio.htm

You should really look at the functions getch() and gotoxy(). They can really come in handy if you try to make a game in the console.

something1990 wrote:
Is there a C++ include file that allows GUI programming?

I don't think you can just get an include file, but you can install wxWidgets and use it. http://www.wxwidgets.org/
Liazon wrote:
is System() like lower level than like cout and cin?


Not at all. system() is actually fairly high-level. What it does is simple, it just passes the arguement straight to the OS to be executed. Hence, system("pause") would call the program/command pause. And system("clear") would call the command "clear", which in linux clears the console.

As for a GUI, there isn't an ANSI standard GUI API, so there won't be an include that works on all systems. However, any system with a GUI has more than likely created includes for it. In windows, I believe you can just #include <windows.h>. GUI programming is fairly complex, however, and I encourage you to buy a book on GUI programming for a specific GUI API. I have one for wxWidgets, and it is an amazing resource. It also helps when you want to switch to a different GUI API, as most of the ideas and functions are the same, or highly similar, in other GUI APIs.
foamy3 wrote:
#include <conio> //windows only

int main()
{
clrscr();
return 0;
}


I tried this with dev-c++ and it told me conio was an invalid include file.
Edit: I found a way i could not use system("clear"); so i just changed it to system("cls"); and it worked.
Try adding .h to conio. Also, what you said about system("cls") serves to reinforce what Kllrnohj said a while back. Using system() isn't the best idea and there will probably be other ways of doing what you want to do.
alrigtht ill try that
lafferjm wrote:
Edit: I found a way i could not use system("clear"); so i just changed it to system("cls"); and it worked.


Thats because "clear" isn't a windows command Rolling Eyes
Kllrnohj wrote:
lafferjm wrote:
Edit: I found a way i could not use system("clear"); so i just changed it to system("cls"); and it worked.


Thats because "clear" isn't a windows command Rolling Eyes


Isn't it cls for windows and clear for linux?
Exactly. That's why it wasn't working for lafferjm.
adding the .h made it recognize conio but the clrscr(); wasnt recognized as a command
Argh, you are so incredibly helpless. Do a *LITTLE* searching on your own, plzkthx Rolling Eyes

http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385

clrscr() is only supported by a FEW compilers, there is no real simple way to clear the screen.
this isnt a question about tutorials or anything, but is it possible to create an object named after a string.
You mean something like...


Code:
creatObject("zomg", int);
zomg = 1;


Cause if so, then no. There isn't. Its not possible at all like that. You *can*, however, make a named linked list, which would give a similar effect, just a bit more complicated (and I'm not going to go over linked lists, there are plenty of tutorials that do that - go find one)
i have a book that explains them but i was talking more along the lines of:


Code:

char string[80];
std::cout << "Enter a name: ";
std::cin.get(string, 79);
Person string;
well, aside from that being poor code, that still doesn't work. You still need to use a linked list (or a vector, which would probably be better)

fyi, this would be the "proper" C++ way to get a string (char arrays as strings are discouraged, as they aren't the C++ way, and are the sole cause of all them buffer overflow attacks)


Code:
#include <string>
...
std::string name = ""; //always initialize variables
std::cout << "Enter a name: ";
std::cin >> name;
I tried that a couple of months ago (before learning ASM) and with cpluplus.com and some other tutorials, I was able to do a windows program where a ball moves very slowly (like if it was in ti-basic). There were no delays. (Using Dev-C++)

MS-DOS can be great for easyness of programming, but for user-eye, not very great. After hours of search, I found only one loosy tutorial on object oriented C/C++. Does anyone know a good tutorial for windows oriented C++?
@Fallen: Please read all the way to the end before posting. The topic has changed Smile

And don't program for windows, program for std C++ - standards exist for a reason, don't piss em away for the worse .NET
objects oriented C != C++ != C

it's a different direction for adding OOP to C that is supposedly different from C++ and it's implementation of OOP.

If you want to do cool things, maybe OpenGL and Allegro might be good libraries to work with. I heard they're free libraries and pretty powerful (well OpenGL duh ^^), so maybe that's a good way to make graphics intense games. duno though.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement