Feb 12, 2012 at 3:27pm UTC
print()
{
cout<<"\n ";
cout<<"Item Description Qty Unit Price Amount\n";
cout<<" "<<pn[n]<<" "<<qty<<" "<<up;
return 0;
}
why is it after "pn[n]" it cout in newline??
i want it to be inline output.
by the way, "pn[n]" refers to a dynamic memory
Feb 12, 2012 at 3:31pm UTC
Is pn[n] a string with a newline char in it?
Feb 13, 2012 at 12:04pm UTC
pn= new (nothrow) string [11];
this is the declaration of pn.
whenever i cout it in inline,, it creates newline...
Feb 13, 2012 at 1:03pm UTC
i have solve it my self,, unknowingly,, i put a "\n" (refer to newline) to the declaration of the memory... p[1]="Example\n";
i laugh at it... hahahaha