Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Topics

Recent Status Updates

View All Updates

- - - - -

Dynamic Arrays: Using malloc()

dynamic array malloc array

  • Please log in to reply
2 replies to this topic

#1 china


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:C, Java, C++, C#, PHP, (Visual) Basic, JavaScript, Visual Basic .NET
  • Learning:C, Java, C++, C#, PHP, (Visual) Basic, PL/SQL, Visual Basic .NET

Posted 11 September 2012 - 11:50 PM

Please, help!!! All zero elements are located below the main diagonal in the odd rows and above the main diagonal in the even. use malloc.
  • -1

#2 lintwurm


    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 261 posts
  • Programming Language:C, Java, C++, C#, PHP, (Visual) Basic, Python, Visual Basic .NET

Posted 12 September 2012 - 12:10 AM

Show us the code you have this far and what parts you are having trouble with... Otherwise we will not answer...(We don't do your homework for you) And that question doesn't make any sense or am I just being stupid?
  • 0
No harm was done to the world in sending this message, but a few million electrons have been SERIOUSLY inconvenienced...

#3 lespauled


    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 12 September 2012 - 05:22 AM

I also think this is homework, and it is vaguely familiar. I think I remember having this problem in my first programming class.

You would go about it by allocating a multidimensional array (rows and coloumns).
Iterating through each element in each row and determining if it meats he criteria and changing it's value if it does.

The purpose of this assignment is to make sure you understand matrix, and how to iterate through each elemement and put the "logic" inside of those loops that follow the "business rules."
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

Also tagged with one or more of these keywords: dynamic array, malloc, array

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download