![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script or piece of code where the data returned by a stored procedure you are writing | enigma_83 | Shell Programming and Scripting | 3 | 04-25-2008 03:44 AM |
| help for a perl script - writing to a data file | meghana | Shell Programming and Scripting | 2 | 02-04-2008 02:05 PM |
| Using loop reading a file,retrieving data from data base. | Sonu4lov | Shell Programming and Scripting | 1 | 01-19-2007 12:38 AM |
| help for writing shell script to export table data | sankarg | Shell Programming and Scripting | 3 | 10-18-2006 03:01 AM |
| Writing data onto new lines based on terminator | thanuman | UNIX for Dummies Questions & Answers | 1 | 02-23-2005 03:00 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Writing both 8-bit and 16-bit data to a file
I'm writing both 8-bit and wide 16-bit data to the screen and an output file. I have no problems with writing out to the screen - for example:
cout<<8-bit data; wcout<<16-bit data; Similarly, I have used ofstream for 8-bit and wofstream for 16-bit, for example: ofstream out; wofstream wout; out<<8-bit data; wout<<16-bit data; into the same output file (declared in the ofstream and wofstream constructors). I find two problems with this method: 1. I still get a mix of correct data and ints (from the 16-bit data) 2. I cannot use manipulator functions such as setw and setfill with the wide 16-bit wcout and wout commands. Has anyone experienced this problem? Is there a better way of doing this (ie writing both 8-bit and 16-bit data to one file). Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I found that you can use the WCHAR with the setfill() manipultor, hence:
wcout<<setfill<WCHAR>(' ')<<setw(42) will compile and work fine. |
|||
| Google The UNIX and Linux Forums |