![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#41 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
What I meant to say is there's no reason NOT to move to C#. :-)
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#42 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
A comment on your program: From what I've seen of your posts in PFO, you seem to have a good command of English. I'd DEFINITELY recommend giving your identifiers (variable and function names, etc.) English names, and writing your comments in English as well. Trust me, there are far more programmers who would understand "name" than "navn".
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#43 |
|
Programming Guru
![]() ![]() ![]() |
"(I'm hoping I don't have to learn c++ first... no special reason, just want to start with C#)"
You don't have to know C++ to begin C#. Once you know one language, in my opinion, its just a matter of learning the syntax and features of the next language. The only "bad" thing about C# is that it is not as cross-platform as some of the other languages. C# is primarily for windows, yet there is the Mono Project that tries to port it over to Linux, etc. I suggest going to C# as early as you want to, if you desire... pick up C++ after C#. Knowing multiple languages is always a good idea.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#44 | |
|
Programmer
|
Quote:
, but my english vocabulary and spelling has been getting worse the last months, but I guess that's just a result of not writing enough... oh well... any other comments on the program? -thondal-
__________________
"die" he screamed at the polygon man. When he was done with him, only four points remained, a quad of what he once was. |
|
|
|
|
|
|
#45 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
When I read your posts I don't notice anything that would tip me off to the fact that you're not a native speaker... your English is very good.
As others have said you shouldn't use gets as it's susceptible to buffer overflows. Your program seems to be a good start... good luck!
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#46 |
|
Programmer
|
so, instead of gets what should I use? the scanf? or?
-thondal-
__________________
"die" he screamed at the polygon man. When he was done with him, only four points remained, a quad of what he once was. |
|
|
|
|
|
#47 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
fgets, it allows you to set a maximum number of input characters (can't overflow if you set it correctly). It requires one additional argument, the file pointer, just use stdin (and check your docs). Did someone actually teach you to use gets?:eek:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#48 | |
|
Programmer
|
Quote:
I really did not understand that , (I'm not done with the C dummies book yet) fgets it's better? fgets stands for formatted gets or something right, and then the stdin is? Really appreciate the help, I'm just a slow learner...-thondal-
__________________
"die" he screamed at the polygon man. When he was done with him, only four points remained, a quad of what he once was. |
|
|
|
|
|
|
#49 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
fgets allows you to specify a limit to prevent this type of vulnerability: char buffer[10]; fgets(buffer, 10, stdin); |
|
|
|
|
|
|
#50 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You have an older version of C for Dummies, by the sounds of things... if you can find a newer one, I suggest "upgrading". The older ones teach some bad techniques. In the mean time, remember, gets is bad.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|