Connecting Tech Pros Worldwide Help | Site Map

Question in Arrays - Give an advice

Newbie
 
Join Date: Oct 2009
Posts: 3
#1: 3 Weeks Ago
The following problem has to do with Arrays. I would appreciate if someone could give an explanation in this assumption below:

If we assume that SIZE is a catholic constant with value 100 and A is Array of size SIZE with n stored elements from left to right. If it is assumed that Array's elements are not initialised and at n first position there are numbers from 1 to n in ascending numerical order, what will be the printout of the following command and why ?
for (i=0; i<SIZE; i++)
printf("%d, " A[i]);
Thanks in advance...
Expert
 
Join Date: Mar 2008
Location: Naperville, Illinois U.S.
Posts: 828
#2: 3 Weeks Ago

re: Question in Arrays - Give an advice


Quote:

Originally Posted by PBIRBAS View Post

If it is assumed that Array's elements are not initialised and at n first position there are numbers from 1 to n in ascending numerical order ...

This is a contradiction. Either the array is uninitialized or it is initialized to numbers from 1 to n in ascending numerical order.

I suggest you seek clarification from whoever gave you the problem.
Newbie
 
Join Date: Nov 2009
Posts: 20
#3: 2 Weeks Ago

re: Question in Arrays - Give an advice


I am confused as to the meaning of catholic constant. But I second donbock's answer, the question in itself is a contradiction.
Newbie
 
Join Date: Feb 2008
Posts: 2
#4: 2 Weeks Ago

re: Question in Arrays - Give an advice


What is the meaning for CATHOLIC CONSTANT here... ??? Explain your quiestion little more...
Expert
 
Join Date: Mar 2008
Location: Naperville, Illinois U.S.
Posts: 828
#5: 2 Weeks Ago

re: Question in Arrays - Give an advice


The phrase 'catholic constant' refers to a constant that is accessible in all scopes; perhaps because it is defined in a header that is included by all source files or perhaps because it is defined at the top of the source file or perhaps because it is a global variable. This is an unusual phrase but not an unusual concept. It has nothing to do with religion.
Member
 
Join Date: Aug 2008
Posts: 121
#6: 2 Weeks Ago

re: Question in Arrays - Give an advice


Actually here in greece we refer to global variables as "katholikes variables"... katholikes ---> catholikes --> catholic :P:P
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#7: 2 Weeks Ago

re: Question in Arrays - Give an advice


Quote:

Originally Posted by Tassos Souris View Post

Actually here in greece we refer to global variables as "katholikes variables"... katholikes ---> catholikes --> catholic :P:P

How do you know this OP has anything to do with Greece?
Familiar Sight
 
Join Date: Jan 2007
Posts: 188
#8: 2 Weeks Ago

re: Question in Arrays - Give an advice


Irrespective of the meaning of 'catholic' it must be clear what the value is in array[0]. Go on take a guess and move on.
Reply