Pelles C forum

C language => Beginner questions => Topic started by: boral on June 03, 2012, 07:32:32 PM

Title: Software development in c
Post by: boral on June 03, 2012, 07:32:32 PM
Can anyone suggest a book on how to develop sofware using c programming language?
If ebook is available, please give links.
Title: Re: Software development in c
Post by: dancho on June 03, 2012, 08:29:18 PM
for basic windows programming mr.Charles Petzold :
http://www.charlespetzold.com/pw5/index.html

for advanced windows programming mr.Jeffrey Richter :
http://www.amazon.com/Programming-Applications-Microsoft-Windows-Series/dp/1572319968

starting with C classic one by K&R :
http://www.amazon.com/C-Programming-Language-2nd-Edition/dp/0131103628
Title: Re: Software development in c
Post by: CommonTater on June 03, 2012, 08:33:06 PM
Also do some Google searches for "Teach yourself C in 21 days"... You can view the entire book online in several places.  Or you can order from Amazon... It's a bit more basic than K&R and might serve as a good build up to the more advanced texts.

Also, you should note that ALL these various tomes are intended to be used in a course of deliberate study.  You can't just read them and count on the (average) 50% retention to get you through it. You really do need to study each page, try all the examples, play with the code -- change it, break it, fix it-- and make sure you understand each section before you move on to the next...
 
As the old joke goes... C is easy, Programming is hard.

Good luck on the journey... :D
 
 
Title: Re: Software development in c
Post by: Vortex on June 03, 2012, 11:29:49 PM
theForger's Win32 API Tutorial :

http://www.winprog.org/tutorial

English PDF :

http://winprog.org/tutorial/files/forgers-win32-tutorial-pdf.zip
Title: Re: Software development in c
Post by: CommonTater on June 04, 2012, 12:24:19 AM
theForger's Win32 API Tutorial :

http://www.winprog.org/tutorial

English PDF :

http://winprog.org/tutorial/files/forgers-win32-tutorial-pdf.zip

:D One of my faves...
Title: Re: Software development in c
Post by: boral on June 04, 2012, 09:26:51 AM
Thanks to all of you for these suggestions.
Title: Re: Software development in c
Post by: migf1 on June 06, 2012, 04:33:55 PM
For learning C, have a look at "C Programming, a Modern Approach, 2nd Edition" by King.
IMHO, one of the best introductory texts ever written for C.

For Windows Programming, the already suggested "Forger's Win32 API Tutorial" is an excellent start.
Title: Re: Software development in c
Post by: collectiva on June 15, 2012, 03:05:11 PM
Pls visit the Site Collectiva (http://collectiva.in/) To learn Fundamentals of C Programming online Video Training in Tamil. It is very useful for the Beginners. Very soon the Video Training in English will be uploaded.
Title: Re: Software development in c
Post by: CommonTater on June 15, 2012, 04:25:13 PM
Pls visit the Site Collectiva (http://collectiva.in/%22) To learn Fundamentals of C Programming online Video Training in Tamil. It is very useful for the Beginners. Very soon the Video Training in English will be uploaded.

Well, I went to your website and after it opened about 20 tabs, I finally found your video training page and you're probably going to get real upset at me because of this, but I am going to raise some issues here...
 
1) It's been my experience that nobody learns anything from videos. The average for retained information when passively reading is about 50% and when passively watching a video that falls to something like 20%. 

2) Given the oft reported abysimal state of education in India and the use of an IDE and compiler that haven't been updated since 2005 (Quincy IDE) I'm not going to say much more but I will point you at this Wallstreet Journal Article (http://online.wsj.com/article/SB10001424052748703515504576142092863219826.html) in which it becomes abundently clear that India has real problems dealing with today's latest engineering and technologies. From other Forums I know this problem is real as we saw it every semester as students came online begging for answers to problems they did not understand and a lot of it was pretty basic stuff like making change or figuring out how much paint you need...

3) The correct form of a console program is:
Code: [Select]
int main (void)
  {  int errorlevel = 0;
 
     // your code here
 
     return errorlevel; 
  }
 
// OR
 
int main (int argc, char* argv[])
  {  int errorlevel = 0;
 
     // your code here
 
     return errorlevel;
  }
The returned errorlevel is required by just about every OS as a means of determining if the program worked correctly or not.  (errorlevel is a user variable who's value is calculated by run time error handling code.)
 
 
The only way to learn programming, no matter what language, is to sit down with the book (or e-book) and work through it page by page, typing up and working with every example and quiz as you go; retention rises to almost 80% this way.  You need to work with the code to see what does and doesn't work (both are equally important). You need to understand each section before moving on to the next page... Anything short of this allows faulty recall to limit your absorbtion of necessary skills.

Moreover; there's no point learning on outdated setups with half-functional rad tools included as this just creates a second --far more difficult-- learning curve as the programmer has to un-learn bad habits at the same time as learning about more modern procedures and standards.  I wish I had a dollar for every student I've had to tell why Turbo C won't work on 64 bit OSs.
 
I'm sorry, but I just can't recommend your site to anyone.
 
 
Title: Re: Software development in c
Post by: migf1 on June 15, 2012, 06:24:27 PM
Where is this video located? I was unable to spot it during the first 1-2 minutes of my visit, so I left the site.

PS. I'd like to mention another rather common parameter  (but not exactly standard) for the main function: char **envp (holding a list of the environment variables)... it comes 3rd in the parameters list.
Title: Re: Software development in c
Post by: CommonTater on June 15, 2012, 07:55:29 PM
Where is this video located? I was unable to spot it during the first 1-2 minutes of my visit, so I left the site.

Click the More link in the Programming Contest then look for the Training Videos... you will need to take out a password to see anything but the samples.

If you do enter the contest, you should expect your code to be plagerized.  India's copyright laws are pretty loose.

Quote
PS. I'd like to mention another rather common parameter  (but not exactly standard) for the main function: char **envp (holding a list of the environment variables)... it comes 3rd in the parameters list.

Thanks... forgot about that one.  (I use GetEnvironmentString() mostly)
Title: Re: Software development in c
Post by: czerny on June 16, 2012, 10:57:54 AM
PS. I'd like to mention another rather common parameter  (but not exactly standard) for the main function: char **envp (holding a list of the environment variables)... it comes 3rd in the parameters list.
This is not working in Pelles C, see this (http://forum.pellesc.de/index.php?topic=2472.msg9373#msg9373).
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 12:20:27 PM
PS. I'd like to mention another rather common parameter  (but not exactly standard) for the main function: char **envp (holding a list of the environment variables)... it comes 3rd in the parameters list.
This is not working in Pelles C, see this (http://forum.pellesc.de/index.php?topic=2472.msg9373#msg9373).

Yeap, as I mentioned it is not standard C. However, modern posix, ms and macos-x all support it.

PS1. Not a bad idea for Pelle to also support it in future versions, too ;)
PS2. Thanks for the video pointer, tater.
Title: Re: Software development in c
Post by: CommonTater on June 16, 2012, 04:10:39 PM
Yeap, as I mentioned it is not standard C. However, modern posix, ms and macos-x all support it.
PS1. Not a bad idea for Pelle to also support it in future versions, too ;)

Maybe maybe not... In all my time here you're the first to mention it, so it wouldn't seem to be in demand.  The windows API provides very nice tools for enumerating and parsing environment variables and since Pelles C is, for the most part Windows API based, I'm guessing that's the way to go.

Quote
PS2. Thanks for the video pointer, tater.
You're welcome ....
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 04:29:58 PM

Maybe maybe not... In all my time here you're the first to mention it, so it wouldn't seem to be in demand.  The windows API provides very nice tools for enumerating and parsing environment variables and since Pelles C is, for the most part Windows API based, I'm guessing that's the way to go.

Judging from czerny's link, he was the 1st one mentioning it ;)

Anyway, the only reason for suggesting its addition was in the case Pelle wanted Pelles C to be more compatible with MS c-runtime. Its not a big deal, since getenv() can be used for getting a known environment variable and it is part of the standard C (already supported by Pelles C)... but it cannot enumerate the environment.

Actually, I don't even know if and how many people are aware about this 3rd parameter of the main() function. But Google returns a bloated load of links mentioning it, when searching for "environment variables enumeration in c". In that sense, it certainly won't hurt if Pelles C would support it too ;)
Title: Re: Software development in c
Post by: CommonTater on June 16, 2012, 04:36:32 PM
Actually, I don't even know if and how many people are aware about this 3rd parameter of the main() function. But Google returns a bloated load of links mentioning it, when searching for "environment variables enumeration in c". In that sense, it certainly won't hurt if Pelles C would support it too ;)

Then you should put in a feature request ... Write up a little article demonstrating the need and see what happens. :D   Pelle is very good about saying "yes" or "no" to these things, which is as it should be.
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 04:44:33 PM
Actually, I'm not concerned that much about Pelles C's support of envp, because I use mingw gcc along with Pelles.
I only mentioned it for the shake of completeness, regarding main(), because it's quite common on most c-platforms, or at least on the most popular among them.

PS. What kinda bothers me though, is the fact that I cannot close poIDE tabs by double-clicking on them (this I will officially file it as a feature request, but I have to search that it is not already filed).
Title: Re: Software development in c
Post by: CommonTater on June 16, 2012, 04:52:07 PM
Actually, I'm not concerned that much about Pelles C's support of envp, because I use mingw gcc along with PS. What kinda bothers me though, is the fact that I cannot close poIDE tabs by double-clicking on them (this I will officially file it as a feature request, but I have to search that it is not already filed).

Try right clicking on the tabs...

I'd rather they not close on double clicks, as a safety measure against accidental closures.
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 04:58:27 PM

Try right clicking on the tabs...

I'd rather they not close on double clicks, as a safety measure against accidental closures.
Right-clicking works just fine, but it slows me down so much :)
Of course I'll request it as an optional addition to the current behavior.

PS. I've hi-jacked the topic :P
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 05:14:31 PM
PS. I've hi-jacked the topic :P

Since I've already done it  ;D , allow me to abuse it a little bit more: does version 7.00rc3 come without any pre-installed addons? I installed it today on my Win7 64bit machine and it didn't have any.
Title: Re: Software development in c
Post by: CommonTater on June 16, 2012, 05:17:45 PM
PS. I've hi-jacked the topic :P

Since I've already done it  ;D , allow me to abuse it a little bit more: does version 7.00rc3 come without any pre-installed addons? I installed it today on my Win7 64bit machine and it didn't have any.

Install the AddIn SDK as well... you'll get a couple of extra wizards and addins in the bargain.
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 05:23:17 PM
Cool, thanks :)

Title: Re: Software development in c
Post by: Bitbeisser on June 16, 2012, 05:59:45 PM
Anyway, the only reason for suggesting its addition was in the case Pelle wanted Pelles C to be more compatible with MS c-runtime.
What M$ C runtime? Microsoft has pretty much abandoned C, caring only about their C++?Ccrap stuff...

Pelle's C is pretty much the only serious plain C compiler out there, and his intentions seems to to adhere to the C standards, which is perfectly fine...

Ralf
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 06:09:23 PM
What M$ C runtime? Microsoft has pretty much abandoned C, caring only about their C++?Ccrap stuff...

That's so very true!

However, VC++, C++ Builder and MinGw are very (very) popular and by default they use the MS C runtime. I thought it would be nice if Pelles could give those users one more reason to make the switch ;)

Quote
Pelle's C is pretty much the only serious plain C compiler out there, and his intentions seems to to adhere to the C standards,...

Ralf

No question about that!
Title: Re: Software development in c
Post by: czerny on June 16, 2012, 06:58:25 PM
Yeap, as I mentioned it is not standard C. However, modern posix, ms and macos-x all support it.

PS1. Not a bad idea for Pelle to also support it in future versions, too ;)

If I remember right, I had to port a third party library. In such cases it would be very handy to have this option or the POSIX variant.
Title: Re: Software development in c
Post by: Stefan Pendl on June 16, 2012, 09:39:40 PM
The main entry point signature is described as to support the environment block at The main Function and Program Execution (http://msdn.microsoft.com/en-us/library/3ze4ytsc%28VS.80%29.aspx) at MSDN.

Since we are developing for Windows, we should have the ability to use the official signature of the main function.
Title: Re: Software development in c
Post by: migf1 on June 16, 2012, 11:28:01 PM
...
In such cases it would be very handy to have this option or the POSIX variant.

Starting from the msdn main() link presented by Stefan Pendl, I just discovered that a corresponding char **_environ global var is also present in the MS C runtime, via <stdlib.h> (along with its wide variant, _wenviron): http://msdn.microsoft.com/en-us/library/stxk41x1%28v=vs.80%29.aspx

Although it is clearly marked as depreciated at msdn, I just tested it with the latest mingw gcc and it works just fine...

Code: [Select]
#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    extern char **_environ;
    char **env = _environ;

    while ( *env )
        puts( *env++ );

    system( "pause" );
    exit(0);
}

Pelles C doesn't support it though.
Title: Re: Software development in c
Post by: Stefan Pendl on June 17, 2012, 12:03:32 AM
After taking a closer look the third parameter seems to be M$ VS/VC specific.

Anyways this would just be the environment block state at the start of the program, which can easily be retrieved by the GetEnvironmentStrings function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683187%28v=vs.85%29.aspx).
Title: Re: Software development in c
Post by: migf1 on June 17, 2012, 12:08:48 AM
After taking a closer look the third parameter seems to be M$ VS/VC specific.

Yeap, it's not standard C.
But it is supported by most major c dev platforms (windows, posix, macos).

Quote
Anyways this would just be the environment block state at the start of the program, which can easily be retrieved by the GetEnvironmentStrings function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683187%28v=vs.85%29.aspx).

Yes, CommonTater also pointed it out.