-2

So I don't know If this is the right place to ask this. I am new to programming, I am not very in to it (I know classes,arrays,functions..etc(Basic Things)).

I was programming with Visual Studio 2013 , so I decided to change my OS to Linux.

First things I notice is that the code is not exactly the same also the including headers. For example: I can't use conio.h and with it I can't end my main function with _getch(); function.

My question is: What's the difference between windows and linux programming? Can someone recommend me where can I look/read for this changes(whats the different and what can I use with linux).

Any help will be appreciated! Thank you in advance !! :)

closed as too broad by BЈовић, Bart van Ingen Schenau, user40980, GlenH7, Dan Pichelman Mar 11 '15 at 1:51

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

3

You could also be interested in the system programming aspect of your task. Then read Advanced Linux Programming, read the intro(2) & syscalls(2) man pages. Be aware of the POSIX standard.

For thread programming, read a good Posix thread tutorial or a C++11 thread tutorial.

Regarding C++ programming, the Qt and POCO projects should interest you (and also perhaps Boost): they provide you with a cross-platform framework.

Regarding tools and programming habits, see these hints.

I recommend using at least C++11, not some earlier C++ standard (see documentation on cppreference & on cplusplus, etc...). So use recent versions of compilers (e.g. GCC 4.9 or Clang/LLVM 3.5 at least, in spring 2015). Don't forget to enable all warnings and debug info.

Study the source code of some existing free software (see e.g. sourceforge or github, etc...), you'll learn a big lot. Try even to contribute to it.

BTW, learning other programming languages (e.g. Scheme with SICP, Haskell, Ocaml, Prolog, Python, ...) will also teach you a big lot (even improve your way of thinking in C++).

  • This is a nice answer, regarding the systems programming. Except that – unless the OP wants to understand how the operating system thinks about threads – I would strongly recommend studying the C++11 thread model. Of course, on GNU/Linux, C++11 threads will very likely be implemented using Pthreads so most things you read about Pthreads should be applicable. But then, you are again depending on knowledge of low-level implementation details. – 5gon12eder Mar 10 '15 at 14:42
  • Agreed, but the Posix thread tutorial gives explanation that are relevant to C++11 threads. – Basile Starynkevitch Mar 10 '15 at 14:42
2

There are the features that the language provides, and there are other features that the OS provides. iostream for example is built in to the language. conio.h is specific to Windows. There are other headers too that are specific to Linux.

1

The reason you find differences is that the C you are using is not GNU C or ANSI C. It's better if you learn the language well instead of trying to find the differences.

I'd suggest referring

C: The C Programming Language, 2nd Edition by Brian W. Kernighan and Dennis M. Ritchie

C++: The C++ Programming Language (3rd Edition) by Bjarne Stroustrup

  • 1
    Its the 4th edition better?\ – Huntix Mar 10 '15 at 12:45
  • @Huntix 4th edition focuses more on C++11 features. But is a good read anyway. – UldisK Mar 10 '15 at 12:50
  • 1
    Defenitely read the 4th edition. C++11 almost feels like a new language that is safer, faster and much more enjoyable to program. You really want to learn the modern usage, not the technology that was used a decade ago. – 5gon12eder Mar 10 '15 at 14:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.