Apparently there is some problem with the passing Array by reference in my code.
There is a linking error.
Edit: Error File Attached
#include<iostream.h>
#include<conio.h>
void input_array(int (*A)[],int);
/*
void sel_sort(int[],int);
void buble_sort(int[],int);
void insertion_sort(int[],int);
*/
void show_array(int (*A)[],int);
void main()
{
int A[50];
int size;
char ch_1;
clrscr();
cout<<"Following choices are available:\n\
1. Input Array\n\
2. Sort Array\n\
3. Show Array\n\
4. Exit\n\
\n\
What do you want to do?(1-4)";
cin>>ch_1;
switch(ch_1)
{
case '1':
input_array(&A,size);
break;
case '2':
cout<<"Area Under Devolopment";
break;
case '3':
show_array(&A,size);
break;
case '4':
cout<<"Area Under Devolopment";
break;
}
clrscr();
main();
getch();
}
void input_array(int A[],int size)
{
cout<<"Enter the no. of size of the Array:\n";
cin>>size;
cout<<"\nEnter the elements of the array: ";
for(int i=0;i<size;i++)
{
cout<<"Enter the Array element "<<i+1<<": ";
cin>>A[i];
}
}
void show_array(int A[],int size)
{
for(int i=0;i<size;i++)
{
cout<<A[i]<<"\t";
}
}
Edit:
And heads up.
I had a problem with my Directories.(in c++)
The output and source directories were not accesible
and c++ showed a fatal error
saying program name.obj is not created.
I fixed that by changing the directories to valid location.
i hope that is not the problem....
Attached File(s)
-
Error.bmp (126.49K)
Number of downloads: 24
This post has been edited by sumit.xxx365: 28 March 2011 - 10:32 AM

New Topic/Question
Reply




MultiQuote





|