dollar sign declaration
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: dollar sign declaration

  1. #1
    Join Date
    Jul 2009
    Posts
    14

    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;

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: dollar sign declaration

    can i just declare it in my list of declaration like this:
    try it and see what happens.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: dollar sign declaration

    You could.....but I'm not sure why you'd want to. Since "dollar" is six characters and "$" is 3.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center