mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
solve bus-error (core dumped), run-time error
- Run time error on linux. - 'n' is declared but not initialized, neither its value is taken from user. - 'n' contains garbage value, thus throws run time error.
This commit is contained in:
parent
f499342869
commit
485d1b2bb8
@ -6,8 +6,10 @@ using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
cout<<"Enter the number of elements in your array: ";
|
||||
cin>>n;
|
||||
int Array[n];
|
||||
cout<<"\nEnter any 6 Numbers for Unsorted Array : ";
|
||||
cout<<"\nEnter any "<<n<<" Numbers for Unsorted Array : ";
|
||||
|
||||
//Input
|
||||
for(int i=0; i<n; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user