|
-
July 27th, 2009, 10:32 AM
#1
dollar sign declaration
i am doing a program on budget at the moment and have already finished the program. The program uses a lot of dollar sign for output. MY question is, instead of having to put in "$" every time in each output, can i just declare it in my list of declaration like this:
char dollar='$';
hence i could use it in the following manner;
cout<<dollar<<housing<<endl;
cout<<dollar<<food<<endl;
instead of
cout<<"$"<<housing<<endl;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|