Computing.Net > Forums > Programming > C++to c converting help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++to c converting help

Reply to Message Icon

Name: Brooklyn1126
Date: March 31, 2004 at 14:23:45 Pacific
OS: winxp and RHlinux 9.0
CPU/Ram: p4
Comment:

Hi i am converting a program from C++ to C and i have an output statement like this in C++ :
cout<<"Total Charges: $" << Group.Packs.Spel.Charges << endl;

and i have to convert it to C so i know i have to replace cout<< with printf(" ") but how do i make it print the Group.Packs.Spel.Charges ?? Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: March 31, 2004 at 15:11:30 Pacific
Reply:

printf("Total Charges: $%f\n", Group.Packs.Spel.Charges);


If Group...Charges is not a float, then you'll need to change the %f to the appropriate data type (probably %d)


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++to c converting help

C++: Convert Multibyte buffer to integer www.computing.net/answers/programming/c-convert-multibyte-buffer-to-integer/1659.html

C++ prgramming help www.computing.net/answers/programming/c-prgramming-help/18183.html

New to C, need help Programming www.computing.net/answers/programming/new-to-c-need-help-programming/5505.html