|
Posted by Jonathan N. Little on 09/28/07 14:20
Blinky the Shark wrote:
<snip>
> <pre>
> <code>
>
One could say that the use of PRE to format multiline code snippet is
presentational and not semantic, like B, I, BIG & SMALL... Personally
what I do is just create a class for larger multiline code snippets.
code.bigSnippet {
display: block; margin: .5em 1em; padding: .5em;
border: 1px solid #ccf; white-space: pre;
}
<code class="bigSnippet">unsigned int findprime(vector<unsigned int>
prime, unsigned int target)
// Finds the Nth prime number in a sequence
// # if the prime vector already has the target, return it,
// # else find it and fill up vector with results.
{
unsigned int x = prime.back()+1;
while( target != prime.size() )
//while we have not gotten to the target
{
if (isprime(prime, x) )
{prime.push_back( x);}
x++;
}
return prime[target-1];
</code>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|