|
|
Up |
|
|
  |
Author: Richard HeathfieldRichard Heathfield
Date: Mar 31, 2007 23:58
ilan pillemer said:
> Richard Heathfield writes:
>>
>> I consider "infinite loops" to be an aberration, not an idiom.
>>
> When I look at "Lions' Commentary on Unix 6th Edition", and I page
> through the source code to Sheet 15
> ...and pass my eye to main()... (line 1550)
> ...and let my eye read the code to line 1562.. this is what I see...
>
> for (;;) {
> UISA->r[0] = 1;
> if(fuibyte(0) < 0)
> break;
> clearseg(i);
> maxmem++;
> mfree(coremap, 1, i);
> i++;
> }
> ...
|
| Show full article (2.27Kb) |
|
| |
no comments
|
|
  |
Author: CBFalconerCBFalconer
Date: Mar 31, 2007 23:26
>
... snip ...
>
> Those are extremely stupid (ignorant) and inappropriate
> recommedations.
This has gone far enough. Feels like kicking a dog, but all it
ever does is whine and snarl. PLONK.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
< http://cbfalconer.home.att.net>
|
| |
|
| |
no comments
|
|
  |
Author: ilan pillemerilan pillemer
Date: Mar 31, 2007 23:02
Hi,
I have made an attempt at exercise 1.14 in K&R2: namely;
"Write a program to print a histogram of the frequencies of different
characters in its input."
Here is my program and the output.
#include
#define HISTHEIGHT 400
int main()
{
int c, i, j, tot;
int nchars[26];
for (i = 0; i < 26; i++)
nchars[i] = 0;
|
| Show full article (4.86Kb) |
|
3 Comments |
|
  |
Author: Keith ThompsonKeith Thompson
Date: Mar 31, 2007 22:47
SM Ryan tango-sierra-oscar-foxtrot-tango.fake.org> writes:
>>> From: Keith Thompson mib.org>
>>> A Von Neumann architecture is one with a single address space for
>>> both data and code. This is by contrast to a Harvard
>>> architecture, in which data and code are stored disjointly.
>>> Nothing in C specifies or prefers one over the other.
>>
>> If you're correct, then there's no portable way in C to cast a
>> function pointer to a byte pointer and thereby be able to obtain
>> the machine code for the function, nor to modify the machine code
>> such as planting a breakpoint.
>
> There's no ANSI C portable way because they don't define a
> conversion between data and code pointer. You can come up with
> a rationale (there are others) but that's not the reason, just
> a rationale for the reason. There is a Unix portable way, because
> various Unix standards do define a conversion.
>
> On some systems the function pointer is a pointer to code ...
|
| Show full article (1.86Kb) |
|
no comments
|
|
  |
Author: HarryHarry
Date: Mar 31, 2007 22:37
Hi all,
1)I need your help to solve a problem.
I have a function whose prototype is
int reclen(char *)
This function has to find the length of the string passed to it.But
the conditions are that no local variable or global variable should be
used.I have to use recursive functions.
2)sizeof(int) is 2 bytes in turboC.It is 4 bytes in case of gcc.why
different compilers allocate different amount of memory?what is the
reason behind it?
|
| |
|
4 Comments |
|
  |
Author: ilan pillemerilan pillemer
Date: Mar 31, 2007 22:34
Keith Thompson mib.org> writes:
> ilan pillemer pillemer.net> writes:
>>> "Raman" gmail.com> ha scritto nel messaggio
>>> news:1174888462.121404.204270@l75g2000hse...
|
| Show full article (1.18Kb) |
|
no comments
|
|
  |
Author: Default UserDefault User
Date: Mar 31, 2007 21:58
Robert Maas, see http://tinyurl.com/uh3t wrote:
[big load of crap]
I think I already plonked you at work, and now I'm sure as anything
plonking you here.
What a waste of space you are.
Brian
|
| |
|
no comments
|
|
  |
|
|
  |
Author: Keith ThompsonKeith Thompson
Date: Mar 31, 2007 21:35
>> From: Keith Thompson mib.org>
>> A Von Neumann architecture is one with a single address space for
>> both data and code. This is by contrast to a Harvard
>> architecture, in which data and code are stored disjointly.
>> Nothing in C specifies or prefers one over the other.
>
> If you're correct, then there's no portable way in C to cast a
> function pointer to a byte pointer and thereby be able to obtain
> the machine code for the function, nor to modify the machine code
> such as planting a breakpoint.
Correct.
|
| |
|
no comments
|
|
  |
|
|
  |
Author: Keith ThompsonKeith Thompson
Date: Mar 31, 2007 21:18
>>> Ah, so it's *not* plain text, it's compressed with a nonstandard
>>> compressor which confuses lynx (and me, using lynx to view it).
>> From: Keith Thompson mib.org>
>> The Unix system you dial into probably has the bzip2 and bunzip2
>> programs.
>
> Indeed it does, but when the .bz2 file came up as garbage in the
> Web browser, I had no idea that bunzip2 would be the appropriate
> program for uncompressing it, in fact I had no sure knowledge it
> was a compressed text file in the first place.
And now you know, but you're still whining about it.
[snip]
|
| Show full article (2.22Kb) |
|
no comments
|
|
|
|
|
|
|