Click here to Skip to main content
15,900,816 members

Comments by Member 12204396 (Top 3 by date)

Member 12204396 2-Jan-16 15:23pm View    
Yes, actually I'm not really aware of what I do.
Member 12204396 2-Jan-16 14:49pm View    
I tryed to make it like that but it doesnt work:

for (i = 0; i < n; i++)
{
char name_for_check;
cin >> name_for_check;
if (strcmp(array[i].first_name, name_for_check) == 0)
{
cout << array[i].first_name << " ";
cout << array[i].last_name << " ";
cout << array[i].country << " ";
}
}

Member 12204396 13-Dec-15 15:46pm View    
Deleted
Well that's the whole part:
<pre lang="c++">#include <iostream>
using namespace std;
int m, n;
int main() {
int A[4][4];
int i, j;


for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++) {
cout << "\n A[" << i + 1 << "][" << j + 1 << "]=";
cin >> A[i][j];
}

for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++)
cout << A[i][j] << "\t";

cout << "\n";
}
{
int min[4];
for (i = 0; i < 4; i++) {
min[i] = A[0][i];
for (j = 1; j < 4; j++) {
if (min[i] > A[i][j])
min[i] = A[i][j];
}
}
int newarr[5][5];
int max[5] = { 1,2,3,4,5 };
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
newarr[i][j] = A[i][j];
newarr[i][5] = max[i];
}
}

for (j = 0; j < 4; j++)
newarr[5][j] = min[j];
cout << newarr[5][j] << "\t";
cout << "\n";

}

}

</pre>

I put random elements to the max. Because so far I only test. But once I started my program it show correct only the first array.And where should be the new array it shows zero.Here it is the outcome of the debuging:
<pre lang="c++">
5 4 3 1
5 6 7 9
4 2 3 9
4 8 4 6
0
</pre>