Thread: Need Help in Arrays!

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    1

    Need Help in Arrays!

    Hey guys I'm new here!

    I have got a homework and it says the following:

    Write a C program in which you read in one 3x3 Array A and then multiply that array by a letter "a"

    I tried doing that but I faced difficulty multiplying a character by a letter!

    Any Help would definitely be appreciated!

    Thanks..

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Nobody is going to do your home work. Post us your code. May be u can except some thing.

    ssharish2005

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Quote Originally Posted by Squallmania View Post
    Hey guys I'm new here!

    I have got a homework and it says the following:

    Write a C program in which you read in one 3x3 Array A and then multiply that array by a letter "a"
    Uh..... OK......

    Quote Originally Posted by Squallmania View Post
    I tried doing that but I faced difficulty multiplying a character by a letter!
    I don't even understand the problem, so I can't advise you how to do that. I could offer guesses as to what it means to multiply an array by a letter, but I'd rather not.

    If you can explain the problem better, and show us what you attempted, that would probably help us help you.

  4. #4
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Multiplying letters makes no logical sense. If this is for a class, tell your professor that.

    For example, leaving all C code aside, what is the value of A * 1? Ok, maybe A itself.
    But A*2? what is A? If its just a symbol for a numerical value then you need to figure out what A equals. Could be anything.
    A * 2 = A+A, but what you need to do is figure out your symbol values in an array of some sort methinks
    Last edited by MacNilly; 07-07-2007 at 07:02 PM.

  5. #5
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    i think that you have to convert a to a letter than multiply it
    proud to be from aui www.aui.ma and also a great elton john's fan

  6. #6
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Quote Originally Posted by elton_fan View Post
    i think that you have to convert a to a letter than multiply it
    a is a letter.

  7. #7
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    sorry to a digit
    proud to be from aui www.aui.ma and also a great elton john's fan

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >Multiplying letters makes no logical sense.
    Since a char is an integer type, multiplying by the letter 'a' could make sense.

  9. #9
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    IMO, It's either a trick question or the OP didn't copy it here word-for-word.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  10. #10
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Unless they mean 'a', AKA it's position in the ASCII table.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM