Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-08-2008, 11:46 AM
JJJIrish05 JJJIrish05 is offline
Newbie
 
Join Date: Mar 2008
Posts: 10
Rep Power: 0
JJJIrish05 is on a distinguished road
Default Array manipulation Question in C++

Ok so i'm writing a program to sort an array using heap sort. I have my main function that gets the information on what the array is, then using a function to sort it. The function is defined as: void maxheapify(int A[], int i, int len)

So I've figured out that the array doesn't really get modified when I pass the array into the function. But I can't just do A=maxheapify(A, i, len) either because in maxheapify A is an int*... And if I turn the A in main to an int* then I get a whole crap load of errors....

So anyone have any suggestions? I can post my whole code if need be.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-08-2008, 02:06 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 2,057
Last Blog:
wxWidgets is NOT code ...
Rep Power: 24
WingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the roughWingedPanther is a jewel in the rough
Default Re: Array manipulation Question in C++

An array name IS a pointer. You have to receive the array as a pointer in the function.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help regarding the sorting of arrays with flags! Yuriy M C and C++ 3 10-12-2007 10:30 PM
Usage of array structures to increment letter instances of text Yuriy M C and C++ 2 09-13-2007 10:49 AM
fread into array position kenna C and C++ 0 08-17-2007 08:03 AM
Best program for SQL database manipulation Rhadamanthys Database & Database Programming 3 07-02-2007 02:32 PM
Python 2D array question annannienann Python 3 04-23-2007 04:36 PM


All times are GMT -5. The time now is 09:11 AM.

Contest Stats

Xav ........ 162.68
Sacback ........ 120.05
alearb8 ........ 120.05
tfusion ........ 120
amr2107 ........ 120
d3s!gn ........ 120
Qoolman21 ........ 120
Pillager ........ 108
antihero ........ 106
donfrench ........ 100.05

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads