|
-
February 29th, 2012, 05:29 AM
#19
Re: My very first C program (Windows - console)
 Originally Posted by jlewand61
It shouldn't bother anyone whether I take advice or not. It wouldn't bother me if someone deflected my advice. I've sincerely asked to help me get into good C coding habits. C is a new animal and I'm trying to develop good habits from the start.
It bothers us because we are taking the time to review your code, and tell you what we think about it, and how to make it better. Yet you seem bent on ignoring what is said, hence our time is wasted...
----
That said, if you want my advice about trying to move from assembler to C, then I'd actually suggest you learn C++ !
For you, C may only feel like an evolution from assembly, making it hard to shake your old habits, as it allows you to do things "the good old assembly way"
C++ won't take that crap. If you take the time to learn some if it correctly, chances are it will shift your mindset, making it more prepared to learn the C way. C++ will teach you proper encapsulation, abstraction etc.
Once you've learned those, you'll realize they can also be used in C, and will strive to use them.
That and learning C++ is also useful. IMO learning C => C++: bad idea. C++ => C works perfectly fine.
My 0.02$
Is your question related to IO?
Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|