On Fri, Dec 12, 2003 at 08:38:18PM +0200, Aryan Ameri wrote:
> Hi There:
>
> I am a first year CS student, learning C. A while ago I was asked this
> question from a fellow friend of mine:
>
> "Write a program, which promts the uset to enter some numbers. The user
> should terminate the sequenc
On Sat 13 Dec 2003 08:13:09 +(-0500), Paul Morgan wrote:
>
> BTW, the debian community deserves a lot of credit for their QA work.
> Doing QA sucks for the most part, and most folks do their level best to
> avoid being part of it. And yet debian, this cloud of volunteers from all
> over the
On Sat, Dec 13, 2003 at 08:53:50PM -0800, Nunya wrote:
> I'm almost positive the prof. just wanted the guy to use malloc
s/malloc/malloc+realloc/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Sat, Dec 13, 2003 at 09:33:46PM -0700, Paul E Condon wrote:
> cheating. But, from my experience as a univerisity professor, I know
> that the 'rules of the game' are rather different for homework than
> they are for the real world. A homework problem that is of the form "
> construct a system th
On Sat, Dec 13, 2003 at 12:31:00AM -0600, Alex Malinovich wrote:
> On Fri, 2003-12-12 at 15:00, Aryan Ameri wrote:
> > On Friday 12 December 2003 22:38, Alex Malinovich wrote:
> > > On Fri, 2003-12-12 at 14:04, Wesley J Landaker wrote:
> > > > On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
Debian User wrote:
if you really have to do it in a low-level language, do it in assembly
native to that processor. you can even write them inline within your
C code.
asm(" mnemonic_instruction operand, operand");
Debian User wrote:
> if you really have to do it in a low-level language, do it
On Fri, 12 Dec 2003 16:57:12 -0500, Hubert Chan wrote:
>
>
>> "John" == John Smith <[EMAIL PROTECTED]> writes:
>
> John> #include
> John> int main
> John> (
> John>int nNumberofArguments,
>
> Your variable names are too long, which decreases readability. Having
> such a long name do
On Fri, 12 Dec 2003 17:56:54 -0700, Monique Y. Herman wrote:
> On Fri, 12 Dec 2003 at 23:40 GMT, Paul Morgan penned:
> [snip]
>>
>> In the real world:
>>
>> Do the simplest thing that is consistent with the specification.
>> Someone, whose skill level you can't predict, is going to have to
>> ma
What the?
How did that end up getting sent to this group? Anyways, please disregard that
message, as
It is obviously just a screw up on my part during my attempts to get outbound email
working
properly.
On 12 Dec 2003 at 22:35, Scarletdown FeatherTail wrote:
> d
> q
>
>
> --
> To UNSUBS
d
q
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Fri, 2003-12-12 at 15:00, Aryan Ameri wrote:
> On Friday 12 December 2003 22:38, Alex Malinovich wrote:
> > On Fri, 2003-12-12 at 14:04, Wesley J Landaker wrote:
> > > On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> > > > Hi There:
>
> > > Hmmm... sounds a lot like a homework problem.
On Fri, 12 Dec 2003 at 23:40 GMT, Paul Morgan penned:
[snip]
>
> In the real world:
>
> Do the simplest thing that is consistent with the specification.
> Someone, whose skill level you can't predict, is going to have to
> maintain it after you.
Corollary: Regardless of the skill level of the pe
On Fri, Dec 12, 2003 at 08:38:18PM +0200, Aryan Ameri wrote:
> Hi There:
>
> I am a first year CS student, learning C. A while ago I was asked this
> question from a fellow friend of mine:
>
> "Write a program, which promts the uset to enter some numbers. The user
> should terminate the sequenc
On Fri, 12 Dec 2003 20:38:18 +0200, Aryan Ameri wrote:
> Hi There:
>
> I am a first year CS student, learning C. A while ago I was asked this
> question from a fellow friend of mine:
>
> "Write a program, which promts the uset to enter some numbers. The user
> should terminate the sequence of
> "Aryan" == Aryan Ameri <[EMAIL PROTECTED]> writes:
[...]
Aryan> About initializing the array as static, well I thought that way,
Aryan> when I reinitialize it, I would be able to save it's contents (if
Aryan> you know what I mean). I was afraid that if it was a automatic
Aryan> array, when
On Friday 12 December 2003 1:41 pm, Aryan Ameri wrote:
> On Friday 12 December 2003 22:04, Wesley J Landaker wrote:
> > Something like this would work if you fill in some of the blanks:
> >
> > int main() {
> > int *array = malloc(sizeof(int));
> > int size = 0;
> > printf("Enter Number\n");
On Fri, Dec 12, 2003 at 10:21:36PM +0100, John Smith wrote:
> #include
>
> int main
> (
>int nNumberofArguments,
>char* apszArgument []
> )
Hungarian notation! Ugh!
--
Colin Watson [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
wi
> "John" == John Smith <[EMAIL PROTECTED]> writes:
John> #include
John> int main
John> (
John>int nNumberofArguments,
Your variable names are too long, which decreases readability. Having
such a long name does not convey any more information than a shorter
name such as "numArgs" (or
> "Wesley" == Wesley J Landaker <[EMAIL PROTECTED]> writes:
[...]
Wesley> It would be better to allocate memory in chunks, ...
Yes. If you reallocate for every number you read, then it takes O(n^2)
time to read n numbers (assuming realloc has to relocate the data every
time). If you make y
> "Alex" == Alex Malinovich <[EMAIL PROTECTED]> writes:
[...]
Alex> And I wouldn't even bother putting the linked list into an array
Alex> in the first place. If you write a good linked list implementation
Alex> (which, as I said, would be a good exercise) it will already
Alex> support all of
On Fri, 2003-12-12 at 16:00, Aryan Ameri wrote:
[...]
> To the person who suggested the linked-list thing to me. Thanks very
> much. I don't know what they are yet, but it seems something really
> interesting. I'll go back to my cave now, to study them.
Hi, another thing you might want to check
On Friday 12 December 2003 22:38, Alex Malinovich wrote:
> On Fri, 2003-12-12 at 14:04, Wesley J Landaker wrote:
> > On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> > > Hi There:
> > Hmmm... sounds a lot like a homework problem... =)
>
> Yes, it does... :)
See, this is what I was afrai
On Friday 12 December 2003 22:04, Wesley J Landaker wrote:
> On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> > #include
> >
> > main()
> > {
> > int tmp, cnt = 0;
> > static int arr[cnt];
> > printf( "Enter Number\n");
> > scanf( "%d", &tmp);
> > while ( (tmp = getchar() ) != EOF ) {
>
On Fri, Dec 12, 2003 at 08:38:18PM +0200, Aryan Ameri wrote:
>
> "Write a program, which promts the uset to enter some numbers. The user
> should terminate the sequence of numbers by entering EOF character. The
> program should put numbers entered by the user in to a 1D array".
The real answer
#include
int main
(
int nNumberofArguments,
char* apszArgument []
)
{
int nReturncode = 0 ;
int* pnStorage = NULL ;
int* pnTmp = NULL ;
int nNumberofelements = 0 ;
int nNumberofreadfields = 0 ;
int nCounter = 0 ;
int nInput = 0 ;
while ((nReturncode == 0) && ((nN
On Friday 12 December 2003 1:46 pm, Debian User wrote:
> if you really have to do it in a low-level language, do it in
> assembly native to that processor. you can even write them inline
> within your C code.
>
> asm(" mnemonic_instruction operand, operand");
>
Hey, I wouldn't be surprised if some
On Friday 12 December 2003 1:42 pm, s. keeling wrote:
> Incoming from Wesley J Landaker:
> Content-Description: signed data
>
> > On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> > > I am a first year CS student, learning C. A while ago I was asked
> > > this question from a fellow friend
if you really have to do it in a low-level language, do it in assembly
native to that processor. you can even write them inline within your
C code.
asm(" mnemonic_instruction operand, operand");
At Friday, 12 December 2003, Alex Malinovich <[EMAIL PROTECTED]
shack.net> wrote:
>On Fri, 2003-12
Incoming from Wesley J Landaker:
Content-Description: signed data
> On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> >
> > I am a first year CS student, learning C. A while ago I was asked
> > this question from a fellow friend of mine:
>
> Hmmm... sounds a lot like a homework problem...
On Fri, 2003-12-12 at 14:04, Wesley J Landaker wrote:
> On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> > Hi There:
> >
> > I am a first year CS student, learning C. A while ago I was asked
> > this question from a fellow friend of mine:
> >
> > "Write a program, which promts the uset to
On Friday 12 December 2003 11:38 am, Aryan Ameri wrote:
> Hi There:
>
> I am a first year CS student, learning C. A while ago I was asked
> this question from a fellow friend of mine:
>
> "Write a program, which promts the uset to enter some numbers. The
> user should terminate the sequence of numb
Hi There:
I am a first year CS student, learning C. A while ago I was asked this
question from a fellow friend of mine:
"Write a program, which promts the uset to enter some numbers. The user
should terminate the sequence of numbers by entering EOF character. The
program should put numbers ent
32 matches
Mail list logo