473,396 Members | 2,011 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,396 software developers and data experts.

To Find the Operating System

saranjegan
hello, am in development serial port based application which should run on both POSIX and Windows based OS, at a first step i need to find the OS and then i will use relevant OS API to work with the serial port,so can any one suggest me how to find the OS running in C.
Oct 11 '07 #1
2 1444
Firecore
114 100+
hello, am in development serial port based application which should run on both POSIX and Windows based OS, at a first step i need to find the OS and then i will use relevant OS API to work with the serial port,so can any one suggest me how to find the OS running in C.
Serial port?

Are those the small blue ports your monitor is connected to?
Oct 11 '07 #2
Banfa
9,065 Expert Mod 8TB
Serial port?

Are those the small blue ports your monitor is connected to?
No they are the ports that are being replaced by USB, most computers used to have 2 of them but today normally they only have 1. Generally they use the RS232 protocol and can be used for serial communication to a large number of devices.


saranjegan presumably you aren't actually proposing to run the same image on both machines, you are just trying to build a portable program? You should find some compiler symbols that enable you to distinguish which platform you are compiling for.

For instance the MSVC compiler defines the symbol _MSC_VER to its version number, presence of this symbol indicates use of the MSVC compiler and therefore a Windows platform as the target.

Check you compiler documentation for the symbols it defines.
Oct 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Loi | last post by:
Hi All, I use Bulk insert to put data to myTable. When the SQL server is in local machin, it works well. But when I put the data in a sql server situated not locally, then I get a error message...
2
by: James | last post by:
How can i programicly find out what operating system i am using? i have tried using: getenv("OS"); it works works on xp/2000 but it doesn't seem to work on windows95/98/ME. im using ms visual...
27
by: Kevin A | last post by:
Hi, Is there a way to determine the name and version of the operating system in a portable way? (for Solaris/Linux) Thanks, Kevin
1
by: Tony Bansten | last post by:
Assume I have a partition (under WIn2000/WInXP) which is possibly NOT formatted with a files system (e.g. NTFS). This could be a partition on an external USB harddisc. How do I find out if this...
1
by: Robert Robertson | last post by:
Hello Experts. I'm a H/W guy (not S/W) In a C++ code, I need to find/identify all calls that the program sends to the Operating System (Linux). What are the definitions, syntax etc... of such a...
2
by: seash | last post by:
H iam developing my windows form application(ide:visual studio.net 2003, visual c#) on windows 2000 professional operating system , but when i run the exe on Xp operating system, the screen ...
16
by: sudhir | last post by:
hi how to check escape key is pressed when accepting the string as input. Because I do not want to receive a string if user presses the ESCAPE key.. I used ascii code for comparision but I...
3
by: PythonUsr | last post by:
Although I know for a fact that an Operating System can be written in Python, I need to ask some questions to the more advanced users of Python. Uuu and Cleese are two operating systems that...
2
by: Taftheman | last post by:
Hi, i have a system done in VB6 i was wondering is there a way i can find out what operating system is being used. I need this for drive mapping. Would i need to use the file system object at all. ...
6
by: pavanip | last post by:
Hi, I have developed one windows application using vb.net. I have setup that application on windows operating system its working fine on windows os. Now I am trying to do that exe run on Mac...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.