Indian post

<p>It can be done without pointers, and no I didnt recieve any confirmation from them</p>

<p>hello: can u help me then</p>

<p>ok, assuming its a 2D array,</p>

<p>[0] ab
[1] asbas
[2] bd
[3] ze</p>

<p>start=0, end=n-1, mid=(start+end)/2
then use strcmp and update end, start and mid accordingly </p>

<p>hope that helps (although its pretty dumb :p)</p>

<p>hello : good work..... i was goin into too many complications :p</p>

<p>i feel like making the function so radhika if you can hold out for about an hour or so i'll post here</p>

<p>i've got my CS exam next so this'll help me get my things straight :)</p>

<p>astrix lets get you warmed up: WAP to multiply 2 matrices using pointers, (1 iteration preferred)</p>

<p>ooh i absolutely love my matrix multiplication proggy, dunno if this is what you mean tho, i used pointers only to dynamically initialize my matrices:</p>

<h1>include<iostream.h></iostream.h></h1>

<h1>include<conio.h></conio.h></h1>

<p>class matrix {
int <em>mx;
public:
int r,c;
matrix(int r,int c) {
matrix::r=r;
matrix::c=c;
mx=new int[r</em>c];
}
int &x(int i,int j) {
return mx[i*c+j];
}
void input();
void disp();
~matrix() {
delete []mx;
}
};</p>

<p>void matrix::input() {
for(int i=0;i<r;i++) {="" cout="" <<="" "
row="" "="" i+1="" ":
";="" for(int="" j="0;j<c;j++)" cin="">> x(i,j);
}
}</r;i++)></p>

<p>void matrix::disp() {
for(int i=0;i<r;i++) {
for(int j=0;j<c;j++)
cout << x(i,j) << " ";
cout << "
";
}
}</p>

<p>void main() {
clrscr();
int r,c;</p>

<pre><code>cout << "MATRIX A
";
cout << "---------
";
cout << "Rows: ";
cin >> r;
cout << "Cols: ";
cin >> c;
matrix A(r,c);
A.input();

cout << "
MATRIX B
";
cout << "---------
";
r=c; //if A is MxN then B gotta be NxP
cout << "Rows: " << r << endl;
cout << "Cols: ";
cin >> c;
matrix B(r,c);
B.input();

matrix C(A.r,B.c);

// For every C(i,j) initialized as 0,
// increment C(i,j) by A(i,k)*B(k,j) where k is 0 through n
for(int i=0; i<C.r; i++)
for(int j=0; j<C.c; j++) {
C.x(i,j)=0;
for(int k=0; k<A.c; k++)
C.x(i,j)+=A.x(i,k)*B.x(k,j);
}

cout << "

";
cout << "
A x B =

";
C.disp();

getch();

}
</code></pre>

<p>^ this program uses 3 loops so its not very efficient, with pointers it can be done in 1 loop.</p>

<p>ah i have to admit i have no idea what you're talking about. some kind of manipulation using pointers?</p>

<p>actually its a pretty common example demonstrating the power of pointers, ie, how they can reduce memory usage during run time</p>

<p>oks hello, will look it up :)</p>

<p>and radhika tc crashed and then i lost interest, sorry :p</p>

<p>and yayyy!! the 1111th post is mine</p>

<p>stop hmmphing such. you don't steal what's mine.</p>

<p>but i forget, you do hmmph yourself...</p>

<p>yeah syasha... i'm holding out for my jan 1's :( i really do feel thankful i sent in most stuff late (has reached already)</p>

<p>wow!!! a comp class in progress - astrix, u r a good man!!</p>

<p>no that'd be hello, don't judge by the code :p</p>

<p>
[quote]
TO MODS: OKAY SORRY. HERE'S THE TRANSLATION: IPSEM DOREL LORI COTEM. DILA OFEM LOREM DONA.

[/quote]
LOL! That cracks me up!</p>

<p>(yes, i'm catching up backwards)</p>

<p>wat lang is dat merc?? waise did anyone here know merc can SPEAK <em>SEVEN</em> LANGUAGES!! (all intl!!!!!)</p>

<p>laila i think that translation was tongue in cheek pretty much</p>

<p>and i did not know that... i'd like a demo before i believe it ;)</p>

<p>well I can speak more than 12:
English US, UK, India, Canada, Jamaica, South Africa, Singapore, New Zealand .....</p>

<p>well, atleast according to microsoft word :D</p>

<p>lolllll... hellow hello.. been2 global village? im comin tomorro!! :D
u guys i was jus pullin merx leg cuz i dun blv him either.. hehe</p>