Arrays and Pointers in V C++ 6

csharp United States
  • 18 years ago

    Hi everyone:


    I trying to do a function, in Microsoft Visual  C++ 6, and some help would be just great at this point...


    Its supposed to work like this:


    the function receives as input:
       - x, y, r, and hopefully an array (that contains the location of all pixels of a picture), x and y are the coordenates of a certain point. "r" is radius.


    with the coordenates of a received point (x and y), plus the radius, there will be a "virtual" circle inside the picture (its coordenates). This part is not really important.




    *What I need to know, is how to place in the input variables, the array with all the coordenates of the picture, not knowing the size of it, to work with the values of each element there? Syntax?


    *Should I use an array like (int array1 [] [])? I can’t make it work without the size, that I can’t predict? Syntax ?


    *Should I do it with a pointer, like (int *array1)???


    * should I do it with a structure and calculate the size inside the function? And load the array with those values? How?


    Its the syntax that is causing me troubles, that’s where I mostly need help






    Then to make it harder, I got use another array to insert all the diameter line points of a certain vector inside the circle. I can do that with the variable r - radius. But is there a function that calculates the average of the values contained on this diameter array? or I have to do it with basic mathematical code...


    How about variance? is there a function for this? Or


    Thank you very much for any input you can give, about any item.


    LMDG




Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler