1

Im studying computer science and we work with visual studio in calls. I prefer to work with my mac and the windows.h is not supported. Is there any alternate? can i use sleep or _khbit somehow?

smac89
  • 39,374
  • 15
  • 132
  • 179
Gal Zaken
  • 21
  • 2

1 Answers1

4

No way man. If you want to write code for windows, you need a windows machine, or use a vm if you are keen on working on a mac

smac89
  • 39,374
  • 15
  • 132
  • 179
  • That's only part of the answer. You **can** use *Windows.h* (and any other Windows SDK header file) on Mac OS X, as long as you are using it with a cross-compiler targeting Windows. It's not clear from the question what the OP is trying to accomplish, and this answer is based on a lot of assumptions (like addressing random users of this site as *"man"* were appropriate). – IInspectable Nov 15 '16 at 08:50
  • @IInspectable if you know of a cross platform compiler that works on Mac, or possibly a version of Visual studio that works on Mac, you should give that as an answer. The crux of my answer came from the OP asking how to make use of windows api in an OsX environment, and that's just not how C works – smac89 Nov 15 '16 at 15:46
  • 1
    See [Microsoft is bringing Visual Studio to the Mac](http://www.theverge.com/2016/11/14/13621116/microsoft-visual-studio-coming-to-mac) and [Introducing Visual Studio for Mac](https://webcache.googleusercontent.com/search?q=cache:Vk2On-9psscJ:https://msdn.microsoft.com/en-us/magazine/mt790182.aspx+&cd=1&hl=en&ct=clnk&gl=uk) – Remy Lebeau Nov 15 '16 at 21:46
  • thank you, as i wrote to David in my class we are building "snake" game that suppose to work in windows CMD. therefore the use for kbhit and sleep. As i understand i need to download that cross platform? Im working with Xcode and Lion. Do you know if i can use it with this programs? – Gal Zaken Nov 17 '16 at 13:27