944,098 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 519
  • C RSS
Dec 3rd, 2007
0

The Clear

Expand Post »
Well As What I Have Expected There You Are Again!

actually id like to ask if ever you could give me a very simple Array program.
I read books but i wanted to have other simple situations about using array.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rxylion is offline Offline
3 posts
since Nov 2007
Dec 3rd, 2007
0

Re: The Clear

>id like to ask if ever you could give me a very simple Array program.
  1. /*
  2.  * integers.c
  3.  * display an array of integers in consecutive order
  4.  * author: Aia
  5.  */
  6. #include <stdio.h>
  7.  
  8. int main ( void )
  9. {
  10. int integers[] = { 1, 2, 3, 4, 5 };
  11. int i;
  12.  
  13. for ( i = 0; i < sizeof integers / sizeof ( int ); i++ )
  14. {
  15. printf( "%d ", integers[i] );
  16. }
  17.  
  18. return 0;
  19. }
A very simple program. I release it to you under the GPL license. You can knock yourself out
modifying it and making any kind of changes you see fit.
Last edited by Aia; Dec 3rd, 2007 at 9:23 pm.
Aia
Reputation Points: 2224
Solved Threads: 218
Nearly a Posting Maven
Aia is offline Offline
2,304 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: help with program using structures and printing to screen
Next Thread in C Forum Timeline: save file names into char array





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC