Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [Andy] Code function.

Quote Reply
Re: [Andy] Code function. In reply to
Putting a '.' in the [ ] also breaks my perl -- what I have to type isn't what I mean, and on top of that, it's inconvenient. Tongue... like I said, it's a (very) contrived example, but ./i is mot the same as /i. If, in order to get your code to display correctly, you have to manually edit it, why bother providing the code tags at all?

Have another example, this time in C... now, adding a '.' to the [ ] part doesn't just change the meaning of the program, it introduces an actual error -- it's something my brain balks at. And having the markup interpreted results in a program that doesn't do what I wanted it to do.

Again, I suggest that having the markup interpreted within code tags is a misfeature Wink

Code:
#include <stdio.h>

int
main(void)
{
int arr[25] = { 1, 1 };
int i;

for (i = 2; i < sizeof arr / sizeof arr[0]; i++)
arr = arr[i - 1] + arr[i - 2];

printf("The %dth Fibonacci number is %d", 25, arr[24]);

return 0;
}
Subject Author Views Date
Thread Code function. bluesnavigator 3111 Nov 21, 2004, 11:08 AM
Thread Re: [bluesnavigator] Code function.
Andy 3020 Nov 22, 2004, 4:15 AM
Thread Re: [Andy] Code function.
twist 2999 Nov 22, 2004, 5:47 AM
Thread Re: [twist] Code function.
Andy 3012 Nov 22, 2004, 5:53 AM
Post Re: [Andy] Code function.
twist 3006 Nov 22, 2004, 6:14 AM