creating unnecessary newline


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
Is pn[n] a string with a newline char in it?
pn= new (nothrow) string [11];

this is the declaration of pn.
whenever i cout it in inline,, it creates newline...
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
Topic archived. No new replies allowed.