comp.lang.c
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
March 2007
motuwethfrsasuw
   1234 9
567891011 10
12131415161718 11
19202122232425 12
262728293031  13
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: Reading a key inside a loop         


Author: Richard 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
  Re: Man pages and standards (was months ago: Requesting advice how to clean up C code for validating string represents integer)         


Author: CBFalconer
Date: Mar 31, 2007 23:26

"Robert Maas, see http://tinyurl.com/uh3t" wrote:
>
... 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>

--
Posted via a free Usenet account from http://www.teranews.com
no comments
  K&R2 Ex1-14         


Author: ilan 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
  Re: VonNeumann/Harvard architecture (was: Places=lvalues and <ot>Pop11</ot>)         


Author: Keith Thompson
Date: Mar 31, 2007 22:47

SM Ryan tango-sierra-oscar-foxtrot-tango.fake.org> writes:
> rem642b@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) wrote:
>>> 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
  Recursive functions         


Author: Harry
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
  Re: sizeof dataTypes at run time         


Author: ilan pillemer
Date: Mar 31, 2007 22:34

Keith Thompson mib.org> writes:
> ilan pillemer pillemer.net> writes:
>> "Army1987" writes:
>>
>>> "Raman" gmail.com> ha scritto nel messaggio
>>> news:1174888462.121404.204270@l75g2000hse...
Show full article (1.18Kb)
no comments
  Re: Nitpicking over how a disabled low-income person copes (was months ago: Requesting advice how to clean up C code for validating string represents integer)         


Author: Default 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
  Re: Reading a key inside a loop         


Author: Default User
Date: Mar 31, 2007 21:39

Jorgen Grahn wrote:
Show full article (0.46Kb)
no comments
  Re: VonNeumann/Harvard architecture (was: Places=lvalues and <ot>Pop11</ot>)         


Author: Keith Thompson
Date: Mar 31, 2007 21:35

rem642b@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) 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.

Correct.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
no comments
  Re: bzip2, unicode+0097, finances, sue spammers (was: Various C standards/documents ...)         


Author: Keith Thompson
Date: Mar 31, 2007 21:18

rem642b@yahoo.com (Robert Maas, see http://tinyurl.com/uh3t) writes:
>>>> <http://cbfalconer.home.att.net/download/n869_txt.bz2> is a
>>>> compressed (with bzip2) plain-text draft.
>>> 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
1 2 3 4 5 6 7 8 9