LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2003, 01:57 AM   #1
aditya
Member
 
Registered: Aug 2002
Distribution: RH 7.x
Posts: 71

Rep: Reputation: 15
Thumbs up program size question


Hi,
Which of the following code will result in max. exe size, or to be more appropriate, which of the following codes will occupy greates and least memories when running:

(1) int arr[100];
main()
{}

(2) main()
{
int arr[100];
}

(3) main()
{
static in arr[100];
}



I think that at least (1) and (3) should require same memory on runtime beacuse in both cases the varilable are stored on the Data Segment. But which is greatest and least, or will all of them require same amount of memory?

Thanks.

adi
 
Old 05-01-2003, 04:52 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I suggest you try it? :)

Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Size Question and how to Rick Harvey Linux - Newbie 13 10-30-2005 03:16 PM
Program to print the size of a web file justintime32 Linux - Software 1 06-18-2005 04:19 PM
My First Question - Screen Size oKubricko Linux - Newbie 5 07-29-2004 02:22 PM
partition size question? Lleb_KCir Linux - General 2 05-23-2004 10:21 AM
question about inode size PTBmilo Linux - General 2 03-02-2003 03:20 PM


All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration