Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:57:42 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5vgXi007398 for ; Mon, 24 Nov 2008 21:57:42 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5uEL3001338 for ; Mon, 24 Nov 2008 21:56:14 -0800 Message-Id: <200811250556.mAP5uEL3001338@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Memory Allocation Date: Mon, 24 Nov 2008 21:56:14 -0800 From: Bill Cheng Someone wrote: > I was wondering about allocation of 2D arrays. Suppose I declare an array > : arr[500][20]; , would this be considered to be greater than 8192 bytes > and would there be points deducted for this ? Yes. > Similarly, would that be the case with an array of struct as well, something > like: > > struct foo > { > unsigned char buff[20]; > } object[500]; Yes. I'm not understand why you would write code like this! -- Bill Cheng // bill.cheng@usc.edu