Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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 !! :)

share|improve this question

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

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

    
off-site resource recommendations are explicitly off-topic per help center (it's the same here as at Stack Overflow). See meta.programmers.stackexchange.com/questions/6483/… –  gnat Mar 10 at 17:01

3 Answers 3

up vote 3 down vote accepted

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++).

share|improve this answer
    
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 at 14:42
    
Agreed, but the Posix thread tutorial gives explanation that are relevant to C++11 threads. –  Basile Starynkevitch Mar 10 at 14:42

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.

share|improve this answer

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

share|improve this answer
1  
Its the 4th edition better?\ –  Huntix Mar 10 at 12:45
    
@Huntix 4th edition focuses more on C++11 features. But is a good read anyway. –  UldisK Mar 10 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 at 14:32

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