Question in Arrays - Give an advice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PBIRBAS
    New Member
    • Oct 2009
    • 3

    Question in Arrays - Give an advice

    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...
  • donbock
    Recognized Expert Top Contributor
    • Mar 2008
    • 2427

    #2
    Originally posted by PBIRBAS
    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.

    Comment

    • Ectara
      New Member
      • Nov 2009
      • 24

      #3
      I am confused as to the meaning of catholic constant. But I second donbock's answer, the question in itself is a contradiction.

      Comment

      • jackie79
        New Member
        • Feb 2008
        • 2

        #4
        What is the meaning for CATHOLIC CONSTANT here... ??? Explain your quiestion little more...

        Comment

        • donbock
          Recognized Expert Top Contributor
          • Mar 2008
          • 2427

          #5
          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.

          Comment

          • Tassos Souris
            New Member
            • Aug 2008
            • 152

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

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              Originally posted by Tassos Souris
              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?

              Comment

              • whodgson
                Contributor
                • Jan 2007
                • 542

                #8
                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.

                Comment

                Working...