int output [ was: need help pleaseeeeeeee]
:( hello everyone ...need your helpp pleaseeeeeeeee
is the output value an integer ?or an address and please explain the reason for the value
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int mat[3][6]={ {25,35,26,12,8,7},
{19,27,24,11,4,89},
{6,15,35,36,18,76}};
int*ptr;
ptr=mat[0];
cout<<*ptr<<endl;
cout<<*(ptr+16)<<endl;
cout<<*(ptr)-10<<endl;
cout<<*(ptr++)<<endl;
cout<<*ptr<<endl;
cout<<*ptr+12+*ptr+10<<endl;
cout<<++(*ptr--)<<'\t'<<ptr<<endl;
return0;
}
thank youuuu
[759 byte] By [
malehda3y] at [2007-11-11 8:19:12]

# 2 Re: int output [ was: need help pleaseeeeeeee]
This is awful. Throw it away and re-write the function to perform the desire task, whatever that is. If its homework 1) your on your own and 2) your teacher needs to be taken out back and whacked on the head with a rubber chicken about 50 times.
jonnin at 2007-11-11 21:02:33 >

# 3 Re: int output [ was: need help pleaseeeeeeee]
This is awful. Throw it away and re-write the function to perform the desire task, whatever that is. If its homework 1) your on your own and 2) your teacher needs to be taken out back and whacked on the head with a rubber chicken about 50 times.
Totally agree jonnin.. Some of the stuff they try and teach these days! I remember when an old lecturer of mine was trying to teach us ***ptr??
***!!
# 4 Re: int output [ was: need help pleaseeeeeeee]
hello malehda3y your code have 7 error I fix it , Run it and get the correct result
Good by
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int mat[3][6]={ {25,35,26,12,8,7},
{19,27,24,11,4,89},
{6,15,35,36,18,76}};
int*ptr;
ptr=mat[0];
cout<<*ptr<<endl;
cout<<*(ptr+16)<<endl;
cout<<*(ptr-10)<<endl;
cout<<*(ptr++)<<endl;
cout<<*ptr<<endl;
cout<<(*ptr+12+*ptr+10)<<endl;
cout<<++(*ptr--)<<'\t'<<ptr<<endl;
int x;
cin >>x;
return 0;
}
Mansur at 2007-11-11 21:04:27 >
