473,382 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

int main(int argc, wchar_t* argv[]) using gcc 3.4.2 .

hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing

Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .

Thanks
Vinu

Jul 23 '05 #1
4 4252
Vinu wrote:
hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing

Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .

Use wchar_t (built in type), wcin and wcout (<iostream>) inside the application.
Now there is no standard way for receiving wchar_t from the command line. You will have to
use a system extension for that.

A standard work-around way could be to enter the arguments not from the command line but
from inside the application by using wcin. For example instead of the user entering

../whatever -p he would do:
the program will prompt for them:

../whatever

Please insert parameters:
Just a thought anyway.
--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #2

i want a main like this
int wmain(int argc, wchar_t* argv[])

Jul 23 '05 #3


hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing
Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .
Thanks
Vinu

Jul 23 '05 #4
Vinu wrote:

hi
How can i accept unicode char in command line. The application on
Solaris Sparc expects wide characters for its processing
Can you suggest standard way of doing it on Sun Solaris Sparc? We are
using gcc 3.4.2 .

I suspect it's less a GCC issue than a Solaris OS issue. Most of
the Sun OS's I've used that could handle Unicode at all have UTF-8
(that is, multibyte 8-bit) representations for Unicdoe on all the
system interfaces (program arguments, file names, ...). This is
fine because C++ is defective in defining wchar_t interfaces for
everything that needs them anyhow.

Use the " main(int, char**)" main signature and convert from
multibyte to wchar_t in main.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Steven T. Hatton | last post by:
The short sample program listed below has some features that I find to be bad style. In particular, they fail to communicate the connection between names used in this program and the location in...
9
by: Vinu | last post by:
Hai when i compile the cpp file(cmdargs.cpp) i attached the output below the program int main(int argc, wchar_t* argv) { std::wcout<<L"Name of the Program is "<<*argv<<std::endl;...
14
by: Hal Styli | last post by:
Is this a style thing? int main(int argc, char *argv ) or int main(int argc, char **argv ) i.e. *argv or **argv Why choose the latter?
13
by: Sokar | last post by:
I have my main function set up as int main(int argv, char *argv) so taht i can read in a variable which is passed to the program on the command line. The problem is that main calls other...
1
by: mudanoman | last post by:
Hello, I am new to c and need help with a current program I am working on. Currently, the program (code below) input is as follows: program apple.test.com 51112 What I need is...
7
by: =?Utf-8?B?Vmlu?= | last post by:
Hi, I have a question. I created a simple executable program using Visual C++ from Visual Studio 6.0 This program is called from a script that passes in one argument. Now, my question is: ...
4
by: interec | last post by:
Hi Folks, I am writing a c++ program on redhat linux using main(int argc, wchar_t *argv). $LANG on console is set to "en_US.UTF-8". g++ compiler version is 3.4.6. Q1. what is the encoding of...
3
by: Bill Cunningham | last post by:
I have been having a little trouble with this page. http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/#command-line I wanted to create a command called div that takes two...
2
by: significantBit | last post by:
n00b here. Just started learning C a couple of days ago. I'm using xcode alternatively with emacs. My question is in regards to the main function. Everytime I create a project (standard...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.