# A challange

Show 80 post(s) from this thread on one page
Page 3 of 3 First 123
• 11-01-2008
C_ntua
And just a little history, "algorithm" derives from the name Al' Khwarizmi, the Islamic mathematician who wrote the first book (probably) of algebra.

Also in the definition many would add: "...in finite time"
• 11-01-2008
Akkernight
Well, when I loose something, I give up finding it, and figure another way around, or if I really need it badly, I buy another one of it :P
Anyways, algorithm is some advanced stuff, I guess. Leaving the advanced stuff for now :P
• 11-01-2008
tabstop
Quote:

Originally Posted by Akkernight
Well, when I loose something, I give up finding it, and figure another way around, or if I really need it badly, I buy another one of it :P
Anyways, algorithm is some advanced stuff, I guess. Leaving the advanced stuff for now :P

That's not going to work -- it is not physically possible to write a program without having an algorithm behind it. (Even Hello World has an algorithm behind it, although granted not much of one.) Every time Elysia (or I) asks for a flowchart, that's all that is -- do you have the algorithm in place so that you can even get started writing code.
• 11-01-2008
Akkernight
... If only I really understood what algorithm is :P saying that word to me, is like saying hbula bla bla, makes no sense :P
But I can write a Hello World program, so I guess I do use algorithm, but got no idea what it is...? (I hope :P)
• 11-01-2008
whiteflags
Once again, an algorithm is a step-by-step procedure which solves a problem in a finite amount of time.

A simple step-by-step-procedure for the next problem you will have, reading my post: To see this post, first, you likely clicked refresh on your browser, then scrolled to the end of the page. Then you started reading from left to right since you've determined that the text is English. When you finished, you may or may not have thought about its contents before replying.

When you do understand, then you've completed your task, understanding the word algorithm in a finite amount of time. At that point, you've completed an algorithm to understand the meaning of algorithm.

:p :p :p
• 11-02-2008
Akkernight
Oh... Now I follow, kinda ;)
So my brain is an algorithm user... Strange, didn't even think I used it for anything :P
Well, thanks for clearing that up ^^
• 11-03-2008
BobS0327
Code:

```const char *pDay[] = {"Sunday", "Monday",                 "Tuesday", "Wednesday",                 "Thursday", "Friday",                 "Saturday"};```
Quote:

Originally Posted by Elysia
Yep, that takes care of the bad practice part... But the code is still too complex to understand right away without digging into the code and I am not going to bother to.

Nope, that's wrong. The correct way to use the const keyword in context of the originally posted code is as follows:

Code:

```char *  const pDay[] = {"Sunday", "Monday",                 "Tuesday", "Wednesday",                 "Thursday", "Friday",                 "Saturday"};```
Well, since you won't bother to dissect the code, you won't know whether or not my logic is flawed. Will you?

Also, lint does not flag the pDay variable. It does flag a few other items but not pDay.

Anyone who does not have access to lint and wishes to independently verify any of the statements made in this thread, you can use Splint the freeware equivalent of lint.

Finally, Elysia, you should send your "bad practices" to the Gimpel lint folks. I'm sure they'd be extremely interested in them.
• 11-03-2008
whiteflags
Elysia's next point is almost certainly that in the context of the original program, pDay should be of const char *, at least, due to the fact that assigning to a string literal invokes undefined behavior.

For example
pDay[0][2] = 'N';

as unlikely as that is to occur

She normally doesn't focus on whether pointers would be reassigned (which is safe in this context), but she never fails to scribble off a post about it. She likes to discuss the same talking points repeatedly, even if she can be inept at doing so. The use of the const keyword is largely a matter of adherence to specification.
• 11-03-2008
master5001
I have a function that I wrote that does something like this (it was part of a planner program I wrote for Windows CE a while back). Long story short, its been more than 6 hours since your initial post and I am more likely to be friendly to you if you are at least nice enough to bribe me with mexican food or at least send a birthday card...
• 11-03-2008
Ahmed29
thanks people but i took help from another forums so thanks for giving your ideas :)
Show 80 post(s) from this thread on one page
Page 3 of 3 First 123