![]() |
|
User input |
Hubb the great
Member #3,717
July 2003
|
Im trying to make a save/load box in my editor but how do i get input from the user so the user can write wich file to load/save |
redMarvin
Member #3,714
July 2003
![]() |
I'm working on a similar thing, I can show you <code>cout<<"red_Marvin";</code> |
psundlin
Member #175
April 2000
|
There is so many ways to do that! Read the manual and use your imagination! |
spellcaster
Member #1,493
September 2001
![]() |
The most easy way (IMO) would be to use aDime It's pretty easy to use, so you don't need to bother with the allegro gui. -- |
redMarvin
Member #3,714
July 2003
![]() |
This is a real crappy well example and it's
btw: if you or another one do improvement on this <code>cout<<"red_Marvin";</code> |
23yrold3yrold
Member #1,134
March 2001
![]() |
C:
C++:
The C++ version has some extra functionality, I think (gotta love the string class). -- |
Carrus85
Member #2,633
August 2002
![]() |
Hmm... I smell an AMC library around the corner. This would make a fairly nice AMC module, so you don't have to reprogram input all of the time.
|
MiquelFire
Member #3,110
January 2003
![]() |
I see a possible buffer overflow with 23's C code --- |
23yrold3yrold
Member #1,134
March 2001
![]() |
Yeah. In the C code. Stupid language. -- |
MiquelFire
Member #3,110
January 2003
![]() |
A simple check to see if you're at the end of the string buffer is all you need really to prevent it (both the beginning and the end --- |
23yrold3yrold
Member #1,134
March 2001
![]() |
I know, I know -- |
gillius
Member #119
April 2000
|
If only it were that easy to rag on C. Typically unless you provide the explicit checks on buffer size that you NEED in C, C++-style code unfortunately usually turns the problem from a buffer overflow exploit/crash into a process that runs and runs until it runs out of memory from a 1GB long string (causing a crash anyway and making the system slow in the process). One might say that C++ is more dangerous from taking too much data because it just makes the system slow and crashes softly, whereas in C you crash hard and fast and the system moves on. Although you do prevent root exploits which is the most important of all. EDIT: haha 23 I like that line of reasoning! Gillius |
23yrold3yrold
Member #1,134
March 2001
![]() |
Here; is it fixed now? Might as well correct it since I post it a fair bit
-- |
|