C++: Where to begin?
Hello, I am trying to learn C++ and will be making and compiling everything on Linux.
I am wondering, does anyone know of any good free online resources with some good tutorials and explanations? I've been looking but I can only seem to find ones which assume a Windows development environment. Thanks for your help. |
Quote:
C++ tutorial . I must admit MSDN has pretty good C++ tutorial - of course, nothing related to Linux, but good language coverage. Under Linux you should get familiar with GNU toolchain ; at the top of this forum there is "List of Free Software and Freeware IDEs": http://www.linuxquestions.org/questi...e-ides-469623/ . Start learning about KDevelop, CodeBlocks - off the top of my head. But, the main thing, learn to develop in pure text environment, i.e. learn to understand what is _really_ happening. |
Thank you Sergei, I will look into those things. I will be doing it in pure text too, Vim is my editor of choice, and I will be using it a lot.
|
Quote:
I.e. how compiler is called, how, if necessary, to obtain assembly listing (if you have doubts in compiler and/or want to learn how things work inside), how, if/when necessary, preprocessor is called separately, ditto linker. By the way, look up Linux dynamic libraries HOWTO . And, look up GNU libtool - helps to deal with libraries/linking in general, and on simple examples I tried can even be used (in the presence of other cross-tools) to produce an executable and DLLs for Windows under Linux. Or just on one processor architecture (say, x86) to produce executables for another (say, ARM). |
if you want my idea try to search about C++ videos
videos are more helpful and interesting than reading best wishes |
Quote:
At all, I think learning a programming language from video is a very awkward idea. |
Thank you again Sergei, while I don't really understand any of that stuff yet, I am sure I will learn about it pretty soon. I have written my first C++ program now, it is extremely simple and doesn't really do anything, but it works.
Thank you for your suggestion khodeir, I agree, sometimes videos do make things a little more digestible, but I know that what I am trying to learn isn't just going to sink in immediately, it's going to take a lot of study and practice, and doing the same things over and over again until they become habit. I find it is much easier to read something, then re-read it, and read it some more, rather than keep rewinding a video. |
I've had a little play around with some simple programs, and I have decided to do something real. I am trying to "translate" one of my shell scripts to C++, but I can't find out how to run commands from my program and find the exit status.
I want to find out if a process is running, and kill it if it is. |
give an example and let me see if i can help or not :)
|
Ok, in my original script I used this:
Code:
for i in something something_else |
look
you must do some programs ur self or get them from internet like grep I am sorry to say it will take long time to implement each instruction and pipe line :) if you want to practice C++ try editing files it will be a very good practice you will use all things u have learned |
Haha, ok. Thank you, I knew before I started it was going to be hard but I thought there would be some way to do this.
EDIT: I found a way to run the commands from my program, but how do I know what it returned? Code:
for(myFor=0;myFor<=1;myFor++) { |
Quote:
And read man 2 kill . |
Ok, I now have a way to get the process ID, now I need to learn how to use that kill command you just gave me.
Code:
int kill(pid_t pid, int sig); And I guess that sig will be a number, and man 7 signal tells me that SIGKILL has a value of 9. So is that it? Code:
kill(pid,9); |
Quote:
|
All times are GMT -5. The time now is 02:28 AM. |