🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Adam Carheden Tue, 06 Oct 1998 00:00
#define MAX(), DNM and a working program?
#198
Author: Adam Carheden
Date: Tue, 06 Oct 1998 00:00
15 lines
1011 bytes
Does anyone know what the #define MAX() statement is all about in
Main4.C (I'm just curious).  The book only lists define with respect to
macro guarding.

Also, does it matter if we use the DNM?

Finally, does anyone have a correctly working program?  The sort
function adds multiple nodes for the same name in my program and I'm
stumped.  I just want to completely rule out an error in the Main4.C
file, so if your program works, speak up!

TIA
-- 
Adam
carheden@holly.colostate.edu
Re: #define MAX(), DNM and a working program?
#200
Author: Adam Carheden
Date: Tue, 06 Oct 1998 00:00
15 lines
1187 bytes
Okay, never mind about the third one (working program).  I was writing
my put function as an insert function.  That's what I get for asking my
brain to preform that late.  Anyway, if anyone's interested, I do have a
working program now, so, as expected, Van's Main4.C is just find of
course.

The other two questions (MAX() and DNM) are still unanswered though, so
if you have any thoughts or ideas, speak now.

One more too.  aCC is still giving the same errors I think, so we're
supposed to use CC for this assignment still, right?
-- 
Adam
carheden@holly.colostate.edu
http://holly.ColoState.edu/~carheden
Re: #define MAX(), DNM and a working program?
#201
Author: Jamison Deba
Date: Tue, 06 Oct 1998 00:00
63 lines
2797 bytes
--------------038EC89E25BC250F1B0FC93E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I don't know about the DNM, but the #define in Main4.C is an inline
function.  This is also used to define things like constants (ie. #define
MAX_SIZE 300).

I do have a working program, so I think you can rule out any error in the
Main4.C file.  What compiler are you trying?  I used CC not aCC.

Jamison Deba

Adam Carheden wrote:

> Does anyone know what the #define MAX() statement is all about in
> Main4.C (I'm just curious).  The book only lists define with respect to
> macro guarding.
>
> Also, does it matter if we use the DNM?
>
> Finally, does anyone have a correctly working program?  The sort
> function adds multiple nodes for the same name in my program and I'm
> stumped.  I just want to completely rule out an error in the Main4.C
> file, so if your program works, speak up!
>
> TIA
> --
> Adam
> carheden@holly.colostate.edu

--------------038EC89E25BC250F1B0FC93E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
I don't know about the DNM, but the #define in Main4.C is an inline function.&nbsp;
This is also used to define things like constants (ie. <I>#define MAX_SIZE
300</I>).
<P>I do have a working program, so I think you can rule out any error in
the Main4.C file.&nbsp; What compiler are you trying?&nbsp; I used CC not
aCC.
<P>Jamison Deba
<P>Adam Carheden wrote:
<BLOCKQUOTE TYPE=CITE>Does anyone know what the #define MAX() statement
is all about in
<BR>Main4.C (I'm just curious).&nbsp; The book only lists define with respect
to
<BR>macro guarding.
<P>Also, does it matter if we use the DNM?
<P>Finally, does anyone have a correctly working program?&nbsp; The sort
<BR>function adds multiple nodes for the same name in my program and I'm
<BR>stumped.&nbsp; I just want to completely rule out an error in the Main4.C
<BR>file, so if your program works, speak up!
<P>TIA
<BR>--
<BR>Adam
<BR>carheden@holly.colostate.edu</BLOCKQUOTE>
</HTML>

--------------038EC89E25BC250F1B0FC93E--
Re: #define MAX(), DNM and a working program?
#203
Author: Chris Carlson
Date: Wed, 07 Oct 1998 00:00
23 lines
1417 bytes
Adam Carheden wrote:
> One more too.  aCC is still giving the same errors I think, so we're
> supposed to use CC for this assignment still, right?

Yes, aCC still gives the same errors, but in recitation you'll get the
code changes to make Main4.C work. With the changes, your program 
should compile with both CC and aCC. However, I think they'd prefer you 
use the aCC compiler.

If you haven't been to recitation, here are the changes I made to get
Main4.C to compile with aCC:
1. changed void main() to int main()
2. made the following changes in the sort function:
	***In the function declarations***
	LISTdata hold,jdata,indexdata;
	***In the for loop***
	jdata=list.LIST_Get(j);
	indexdata=list.LIST_Get(index);
        if(strcmp(jdata.name,indexdata.name) > 0)

Hope this helps,

Chris
Re: #define MAX(), DNM and a working program?
#204
Author: Adam Carheden
Date: Wed, 07 Oct 1998 00:00
9 lines
1017 bytes
No, my Rect. is tomorrow, but in case I don't go, are they overriding
the "...must work without changing any code in the main program..."?
Am I correct in guessing that it shouldn't really matter since the
implementation of the ADTs would be the same with the original or
modified Main4.C?
-- 
Adam
carheden@holly.colostate.edu
http://holly.ColoState.edu/~carheden
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads