Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
1.00/5 (6 votes)
See more:
Hey guys,
now i need some help. No, i dont have a code that doesn't run correctly or doesn't run at all. Now i want to amke you a serious question: <<How can I make my C programm run faster and use less memory?>>

If you know anything about it, then plz tell me ASAP.
Thanks for your time.
Posted
Comments
Eugen Podsypalnikov 30-Nov-11 9:53am    
// How can I make my C programm run faster and use less memory?
Is there a function in your C programm
that does make you not sure ? :)
Albert Holguin 30-Nov-11 9:58am    
There's really not a good general answer to this.. it depends on what your code is doing... otherwise the answer would be a 50 page essay... and quite frankly, most of us don't have that kind of time on our hands. Ask google?
Mohibur Rashid 9-Jan-12 18:27pm    
Well, My suggestion would be really rude.
1. Stop bothering people with your pointless question
2. Start doing some real work

 
Share this answer
 
v2
Comments
Albert Holguin 30-Nov-11 13:39pm    
That second article looks like it covers quite a few different topics in optimization... +5
As others already pointed out, you should optimize your code both for speed and memory consumption (and it is a startling task, there is usually a trade-off between these two requirements).
Hand craft optimization is an art and your current attitude (posting an ASAP request at Quick Answer) strongly clashes with.
 
Share this answer
 
What you are asking for is something that is a combination of these qualities:

1. good judgement (generally comes with experience)
2. good knowledge of the target language you are using (usually comes with experience)
3. good education in the basics (requires the use of good books, and frequently good teachers.. can also be gotten through experience).

Bottom line, this is something you can learn, but getting good at it requires time and commitment and correct action (learning from your mistakes).. its not something reducible to a simple 2 paragraph answer on a website, or something you'll learn in a week.

Getting really good at programming, much like getting good at anything, is very time-intensive. Fast food it ain't.
 
Share this answer
 
Wow, I didn't think I'd have to break out the ol' crystal ball this early in the morning. Here's an answer that matches the lack of information in your question, yet strangely applies to pretty much any program written in any language - write better code.
 
Share this answer
 
Comments
XristosMr 30-Nov-11 8:33am    
=.=
CPallini 30-Nov-11 8:48am    
My 5. Even if 'better code' is not exactly a synonymous of 'faster and smaller'.
Mohibur Rashid 30-Nov-11 8:49am    
me like it ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900