![]() |
|
|
#232 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3·29·83 Posts |
I would like to continue, however being a new week, I need to get back to my actual homework, including that "Photoscoop". Let's see how much C I can get done in the process.
As for the loops, one is for reading in characters, and one is so that we can cycle between reading characters and expanding the array... I guess there's got to be a way to simplify it, but 5 minutes of quick thinking isn't shedding too much light on the situation yet. I don't think I want any more hints for now -- but it'll probably be a couple of days before I'll be able to put serious work into this. |
|
|
|
|
|
#233 |
|
Aug 2005
Seattle, WA
2·883 Posts |
|
|
|
|
|
|
#234 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3·29·83 Posts |
Hehe, whoever wrote ecm.c in Prime95 uses gotos for OutOfMemory exits
![]() I have a different version of ReadLine in my head, but haven't actually written it yet :P Will probably do so within the next few days |
|
|
|
|
|
#235 | |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2·11·283 Posts |
Quote:
http://xkcd.com/292/ Last fiddled with by retina on 2012-03-02 at 05:08 Reason: Add a fun link |
|
|
|
|
|
|
#236 |
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
22·3·641 Posts |
|
|
|
|
|
|
#237 |
|
Romulan Interpreter
Jun 2011
Thailand
3·3,221 Posts |
|
|
|
|
|
|
#238 |
|
Basketry That Evening!
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88
3×29×83 Posts |
I'm not saying it's wrong, I'm just saying... I am writing a ReadLine function that used goto's as my exit statements, in almost exactly the same way as is done in many places in ecm.c . jyb was saying I can make the function better, and without any gotos... I'm not sure how to do that, but then again I haven't put much thought into it (yet).
Last fiddled with by Dubslow on 2012-03-02 at 05:18 |
|
|
|
|
|
#239 | |
|
Aug 2005
Seattle, WA
33468 Posts |
Quote:
FWIW, I think gotos are a perfectly legitimate tool, and that like most tools of any use they can be abused. They are perhaps distinguished by having the ability to screw up code far worse and in far less space than most constructs. I.e. they should be used with care. |
|
|
|
|
|
|
#240 |
|
Jan 2008
France
2×52×11 Posts |
|
|
|
|
|
|
#241 |
|
∂2ω=0
Sep 2002
República de California
101101011111112 Posts |
|
|
|
|
|
|
#242 | |
|
"Mark"
Apr 2003
Between here and the
635610 Posts |
Quote:
Then again, they didn't support C99 until two years ago. Try convincing a bunch of 40- and 50-somethings that C99 isn't evil incarnate. For them K&R C is the bible and C++ is a four letter word. Don't get me wrong, C is a great language, but so is C++. The one you choose is dependent upon what you need to do with it. If you care about performance and memory use above all else (like many of the apps we use for factoring, sieving, primality testing), then C (or asm) is for you. If your application would benefit from encapsulation, inheritance, and polymorphism (like most business apps), then C++ is for you. Most apps would benefit from a combination of both and fortunate for us, then can be used together in the same application. |
|
|
|
|