![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Migration from HP-UX to Solaris/Linux | turaga.krishna | HP-UX | 6 | 02-28-2009 07:29 PM |
| Migration Solaris 10 10/08 x86/x64 from UFS to ZFS (Russian) | iBot | Solaris BigAdmin RSS | 0 | 01-08-2009 09:30 AM |
| Solaris migration | mohanpadamata | UNIX for Advanced & Expert Users | 1 | 06-11-2008 05:23 AM |
| Migration Solaris 5.8 to 10 | bruno_a_correia | SUN Solaris | 2 | 08-26-2007 08:17 PM |
| problem with sprintf snprintf in Solaris | diganta | SUN Solaris | 7 | 12-24-2004 07:41 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
solaris appl migration: sprintf decimal separator
Hi,
I am trying to migrate an application from Solaris to AIX 5.3.1. In both platforms the locale settings are as follows: Result of executing "locale" LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" In solaris when you execute this program (this is a sample, in the original code there are lots of classes but at the end they call sprintf function to fill a char[] variable): Code:
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
char cadena[25];
double a = 0;
memset(cadena,0,sizeof(cadena));
sprintf(cadena, "%-f", a);
printf("The content is : %s\n", cadena);
}
IBM XL C/C++ Enterprise Edition for AIX, V9.0 Version: 09.00.0000.0007 In solaris the output is : 0,000000 -> with a comma separator But in AIX when I try to execute this, the result is: 0.000000 -> with a point separator I am trying to migrate the code having in mind the idea of not touching the original code. Any idea?, Thank you in advance for your attention and time. David |
| Bookmarks |
| Tags |
| aix, migration, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|