Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beck322
    New Member
    • Jan 2007
    • 12

    Questions

    I looked at the websides you guys gave me still could not find the answers!!!

    1. How do you pass an array to a function? example?
    2. how do i declare a floating point?
    3. What is inderection when talking about pointers?
    4. Given the following piece of code, what does cout show?
    int*p, i = 15;
    p = &I;
    *p = 20;
    cout<< i ;
    5. can a particular array contain integers, floats, and characters?
    6. What is the value of 2*3 + 7%2-15?
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Originally posted by beck322
    I looked at the websides you guys gave me still could not find the answers!!!

    1. How do you pass an array to a function? example?
    2. how do i declare a floating point?
    3. What is inderection when talking about pointers?
    4. Given the following piece of code, what does cout show?
    int*p, i = 15;
    p = &I;
    *p = 20;
    cout<< i ;
    5. can a particular array contain integers, floats, and characters?
    6. What is the value of 2*3 + 7%2-15?
    Those are some pretty basic questions, if we've posted and you're still having trouble, you should go talk to your teacher.

    Comment

    • bluesteel
      New Member
      • Mar 2007
      • 84

      #3
      Originally posted by beck322
      I looked at the websides you guys gave me still could not find the answers!!!

      1. How do you pass an array to a function? example?
      2. how do i declare a floating point?
      3. What is inderection when talking about pointers?
      4. Given the following piece of code, what does cout show?
      int*p, i = 15;
      p = &I;
      *p = 20;
      cout<< i ;
      5. can a particular array contain integers, floats, and characters?
      6. What is the value of 2*3 + 7%2-15?

      Those are basic questions, look at these answers:
      1- You have a function: int myfunction(int Array[10])
      then you write the name of an array as a parameter.
      2- Don't understand, floating numbers?? float mynumber;
      4- cout shows 15!!!!!!!!
      5- yeah, sure. Only one at a time, but you could define an integer array and your compiler could also "interpret" the numbers and show them as characters, like 65='A'
      6- By using % you get a result as you would using fmod().
      2*3 + 7%2 - 15
      6 + 1 - 15
      6+1+15=22
      Easy, isn't it??

      Comment

      • bluesteel
        New Member
        • Mar 2007
        • 84

        #4
        Originally posted by bluesteel
        Those are basic questions, look at these answers:
        1- You have a function: int myfunction(int Array[10])
        then you write the name of an array as a parameter.
        2- Don't understand, floating numbers?? float mynumber;
        4- cout shows 15!!!!!!!!
        5- yeah, sure. Only one at a time, but you could define an integer array and your compiler could also "interpret" the numbers and show them as characters, like 65='A'
        6- By using % you get a result as you would using fmod().
        2*3 + 7%2 - 15
        6 + 1 - 15
        6+1+15=22
        Easy, isn't it??
        i mistook it should have been:
        6+1-15=-8
        :(

        Comment

        Working...