473,382 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

basics

Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.

Jun 26 '06 #1
14 2255
chitu wrote:
Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.

Basic English is a good start.

--
Ian Collins.
Jun 26 '06 #2

chitu wrote:
Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.


What's the point of starting with the basics of D (look up Digital
Mars) if you want to learn C? It would be off topic here, anyway.

Also, we use English here, not E or text speak.

Jun 26 '06 #3
"chitu" <li*******@gmail.com> writes:
Hope u all of r intersted in C programming.Let start
from d basics.


Yes, we're all interested in C programming. We started from the
basics when this newsgroup was created several decades ago.

If you have any specific questions, feel free to ask them. Before you
do that, please read these links:

<http://www.c-faq.com/>
<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

If you really want to start from the basic of C, this newsgroup isn't
the best place to do it. K&R2 (Kernighan & Ritchie, _The C
Programming Language_, 2nd Edition) is an excellent book; see if you
can buy or borrow a copy. If that's not feasible, there are probably
some good online tutorials -- and a lot of bad ones. Perhaps someone
else can help you find a good one.

And please don't use abbreviations like "u", "r", and "d" for "you",
"are", and "the".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 26 '06 #4
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
"chitu" <li*******@gmail.com> writes:
Hope u all of r intersted in C programming.Let start
from d basics.


Yes, we're all interested in C programming. We started from the
basics when this newsgroup was created several decades ago.

If you have any specific questions, feel free to ask them. Before you
do that, please read these links:

<http://www.c-faq.com/>
<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>


Good advice. And be sure to check out these links as well:

Useful clc-related links:

http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/Aspergers

As well as:

http://en.wikipedia.org/wiki/C_programming_language

Jun 26 '06 #5
01

chitu wrote:
Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.


i have found the following url of great help :
www.cprogramming.com

Jun 27 '06 #6

Keith Thompson wrote:
"chitu" <li*******@gmail.com> writes:
Hope u all of r intersted in C programming.Let start
from d basics.


And please don't use abbreviations like "u", "r", and "d" for "you",
"are", and "the".


"d" is not an abbreviation for "the" , it's an abreviation for "da".
Like
ur da man.

Jun 27 '06 #7
01 wrote:
chitu wrote:
Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.


i have found the following url of great help :
www.cprogramming.com


The first example I came across is somewhat broken:
| #include
|<stdio.h>
|
|int main()
|{
| printf( "I am alive! Beware.\n" );
| getchar();
| return 0;
|}

The #include directive needs to be all on one line. So at the very least
that site needs a bit of proof reading. However, I did not spot any
other obvious problems in the tutorial I looked at.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
Jun 27 '06 #8
01 said:

chitu wrote:
Hi pals,
Hope u all of r intersted in C programming.Let start
from d basics.


i have found the following url of great help :
www.cprogramming.com


That site is broken. If you're serious about learning C properly, ignore the
site completely.

When I go looking for the C tutorial, I eventually find it at: "Lesson 1:
The basics of C++", which claims "to be a stand-alone introduction to C".

I then see a bunch of adverts, right there after the introductory paragraph,
as if the lesson were now over. Poor design, and it really, really makes me
want to write down the product names being advertised there, so that I can
remember to boycott them.

As someone else has already pointed out, the very first example program is
broken (the include directive is split onto two lines). Also, the program
exhibits poor style, as it fails to provide a full prototype in the
function declarator, uses printf where puts would have been better suited
to the task, and has a completely useless getchar call.

"By including header files, you an gain access to many different functions.
For example, the printf function requires getchar." I never heard such
nonsense in all my born days.

"The printf function is the standard C way of displaying output on the
screen." No. The printf function is the standard C way of writing formatted
output to the standard output stream. The Standard does /not/ specify that
printf writes to a screen, and indeed often printf does not do that.

"The actual effect of '\n' is to move the cursor on your screen to the next
line." No. The actual effect of '\n' is - none whatsoever! It's just a
value. It doesn't have an effect. The effect is produced not by '\n' but by
printf. Furthermore, C doesn't require that you have a screen, or a cursor,
so the statement is clearly wrong in that regard also.

"Again, notice the semicolon: it is added onto the end of all lines, such as
function calls, in C."

This is very misleading. Firstly, a function call is not a line. Secondly,
the novice C programming student reading this "tutorial" is not in a
position to know which lines are included in the "such as" and which are
not.

"The next command is getchar()." No, getchar is not a command. C doesn't
have commands.

"This is another function call: it reads in a single character and waits for
the user to hit enter before reading the character." No, it doesn't. It
reads a character from the standard input stream and returns as soon as one
is available or as soon as it becomes evident that no further characters
will be available on that stream. It does not "wait for the user to hit
enter". The operating system might or might not, but getchar doesn't; it
waits for the character to become available (or for a report that this
ain't ever gonna happen).

"This line is included because many compiler environments will open a new
console window, run the program, and then close the window before you can
see the output." Stupid stupid stupid. Just teach them how to use a console
properly instead, FCOL!

Over 30 lines of crit, and I'm still on the first section of the first page.
There simply isn't enough time to list all the problems with that tutorial.

C tutorials at www.cprogramming.com - Just Say No.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 27 '06 #9
Richard Heathfield <in*****@invalid.invalid> writes:
[...]
As someone else has already pointed out, the very first example program is
broken (the include directive is split onto two lines). Also, the program
exhibits poor style, as it fails to provide a full prototype in the
function declarator, uses printf where puts would have been better suited
to the task, and has a completely useless getchar call.
Certainly splitting the include directive is an error. (I suspect the
author was having trouble writing the HTML correctly, but of course
that's no excuse.) And I agree that a full prototype should have been
used for main.

As for using printf rather than puts, I don't see the problem. For a
beginner, remembering a single output function is easier than
remembering a multitude of them; that can come later. I even tend to
use printf() myself where simpler functions like puts() or fputs()
would suffice, and least in quick-and-dirty code (and sometimes the
compiler will replace printf() with puts()).

(Note: "quick-and-dirty" doesn't mean I don't bother to make sure the
program is correct; it just means I tend to favor simplicity over some
other factors.)

After all, even K&R uses printf() for the classic "hello, world"
program.

As for the "completely useless getchar call" ...

[...] "This line is included because many compiler environments will open a new
console window, run the program, and then close the window before you can
see the output." Stupid stupid stupid. Just teach them how to use a console
properly instead, FCOL!


Why should a C tutorial teach how to use a (presumably Windows)
console properly? I'm not even sure how to do so myself (what little
Windows programming I do is under Cygwin, and I use an xterm window,
not a Windows console).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 27 '06 #10
Keith Thompson wrote:

Richard Heathfield <in*****@invalid.invalid> writes:
[...]
As someone else has already pointed out,
the very first example program is
broken (the include directive is split onto two lines).
Also, the program
exhibits poor style, as it fails to provide a full prototype in the
function declarator, uses printf where puts
would have been better suited
to the task, and has a completely useless getchar call.
Certainly splitting the include directive is an error. (I suspect the
author was having trouble writing the HTML correctly, but of course
that's no excuse.) And I agree that a full prototype should have been
used for main.

As for using printf rather than puts, I don't see the problem.

For a
beginner, remembering a single output function is easier than
remembering a multitude of them; that can come later. After all, even K&R uses printf() for the classic "hello, world"
program.
I think printf should be used until after
the tutorial chapter on the string library.

As for the "completely useless getchar call" ... [...]
Just teach them how to use a console
properly instead, FCOL!


Why should a C tutorial teach how to use a (presumably Windows)
console properly?


The final getchar call, suggests that the
code's author doesn't know how to use a console properly.

The way I do it with MSVC,
I found out where the linker's output goes to,
and I wrote a batch file called vc.bat
to change the working directory to where the linker's output goes to
and I put the batch file in the directory
that the dos prompt opens up to.
Then when I open the dos prompt, I enter vc, and I'm there.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\pete>type vc.bat
cd\Program Files\DevStudio\SharedIDE\bin\debug
C:\Documents and Settings\pete>vc

C:\Documents and Settings\pete>cd\Program
Files\DevStudio\SharedIDE\bin\debug

C:\Program Files\DevStudio\SharedIDE\bin\Debug>new
This machine uses: Two's complement.

C:\Program Files\DevStudio\SharedIDE\bin\Debug>

--
pete
Jun 27 '06 #11
Keith Thompson said:

<snip>
As for using printf rather than puts, I don't see the problem.
The problem is that it introduces too many concepts in one go. The beginner
has enough weirdities to fathom in a C program without having to worry
about \n. That can come later.

<snip>
After all, even K&R uses printf() for the classic "hello, world"
program.
And whilst K&R is an excellent book, I don't think it's perfect by any
means. When I get around to writing a better one, I'll let you know. :-)

As for the "completely useless getchar call" ...

[...]
"This line is included because many compiler environments will open a new
console window, run the program, and then close the window before you can
see the output." Stupid stupid stupid. Just teach them how to use a
console properly instead, FCOL!
Why should a C tutorial teach how to use a (presumably Windows)
console properly?


Why should a C tutorial assume you're using a (presumably Windows) GUI? It's
the same only backwards. Do you put a getchar call at the end of your C
programs? I certainly don't. Nor does any serious C programmer I know. Why
teach people a lame way to do things?
I'm not even sure how to do so myself (what little
Windows programming I do is under Cygwin, and I use an xterm window,
not a Windows console).


From memory, assuming a vanilla XP install:

Start/Programs/Accessories/Command Prompt

or just:

Windows-R to bring up a run dialog, and type: cmd

Then cd to wherever your program is, and type in the program name. Hardly
rocket science.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 27 '06 #12
Richard Heathfield <in*****@invalid.invalid> writes:
Keith Thompson said:

<snip>
As for using printf rather than puts, I don't see the problem.
The problem is that it introduces too many concepts in one go. The beginner
has enough weirdities to fathom in a C program without having to worry
about \n. That can come later.


Ok. Personally, I think that introducing \n at this point isn't a
problem; the student doesn't have to understand yet how it works, just
that it's a code that says "this is the end of the line". For
example, it's nice to know that this:
printf("hello, world\n");
and this:
printf("hello");
printf(", ");
printf("world");
printf("\n");
are equivalent.

But then I've never taught C to beginners (except in this newsgroup),
so I don't claim to be an expert on how much information is too much.

I guess I'm trying to say that I disagree without claiming that I'm
right and you're wrong.
<snip>
After all, even K&R uses printf() for the classic "hello, world"
program.


And whilst K&R is an excellent book, I don't think it's perfect by any
means. When I get around to writing a better one, I'll let you know. :-)


Yes, please do! 8-)}
As for the "completely useless getchar call" ...

[...]
"This line is included because many compiler environments will open a new
console window, run the program, and then close the window before you can
see the output." Stupid stupid stupid. Just teach them how to use a
console properly instead, FCOL!


Why should a C tutorial teach how to use a (presumably Windows)
console properly?


Why should a C tutorial assume you're using a (presumably Windows) GUI? It's
the same only backwards. Do you put a getchar call at the end of your C
programs? I certainly don't. Nor does any serious C programmer I know. Why
teach people a lame way to do things?


Ok, that's a fair point. The getchar() call is there specifically to
allow you to see the output in one specific context, running the
program under Windows. Teaching how to do this properly *shouldn't*
need to be part of a C tutorial, but I suppose it would be appropriate
to have a sidebar.
I'm not even sure how to do so myself (what little
Windows programming I do is under Cygwin, and I use an xterm window,
not a Windows console).


From memory, assuming a vanilla XP install:

Start/Programs/Accessories/Command Prompt

or just:

Windows-R to bring up a run dialog, and type: cmd

Then cd to wherever your program is, and type in the program name. Hardly
rocket science.


Well, yes, I know about that. I was thinking there might be a way to
run the program through the Windows GUI without having the window
vanish as soon as the program terminates.

I know a lot of Windows programmers invoke the compiler from some kind
of GUI. There *should* be a way to run a generated program sensibly
from that GUI, rather than having to fire up a separate command prompt
window and find the right directory manually -- and perhaps there is.
Since I'm a command-line guy myself, I'm just displaying my ignorance
in this area.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jun 28 '06 #13
On Wed, 28 Jun 2006 00:17:05 GMT, Keith Thompson <ks***@mib.org>
wrote:
I know a lot of Windows programmers invoke the compiler from some kind
of GUI. There *should* be a way to run a generated program sensibly
from that GUI, rather than having to fire up a separate command prompt
window and find the right directory manually -- and perhaps there is.


Generally, I would expect such a GUI (probably called an IDE) to
provide a way to execute the program and capture the output, and
probably even to run it under a debugger.

It doesn't need to be a special-purpose interface - my editor can
invoke commands to build and execute, while capturing the output in a
separate window. In fact, it (or other versions of it) can do the same
thing under several different operating systems, not just Windows.

But these are questions about tools, not the language.

--
Al Balmer
Sun City, AZ
Jun 28 '06 #14
Keith Thompson said:

<snip>

I guess I'm trying to say that I disagree without claiming that I'm
right and you're wrong.
Fair enough. I suppose we all have different approaches. I'm very much in
favour of the "explain as little as possible, but as much as necessary, at
a time" philosophy, and I think it constructive to defer discussion of
printf until a little later.

<snip>
I was thinking there might be a way to
run the program through the Windows GUI without having the window
vanish as soon as the program terminates.
I don't know of a Win32 GUI technique for doing this, but if the student
programmer is using an IDE it is generally possible to tell it to keep the
program window open. It's certainly possible in Visual C++. With my
keymappings, it's Ctrl-F5, which runs the program outside the debugger, and
which has its own "Press a key to continue" code, so that you needn't
pollute your own program with it. If you want to run /with/ the debugger,
great! Just set a breakpoint on return 0; in main. Easy.
I know a lot of Windows programmers invoke the compiler from some kind
of GUI. There *should* be a way to run a generated program sensibly
from that GUI, rather than having to fire up a separate command prompt
window and find the right directory manually -- and perhaps there is.
Depends on the GUI, obviously, but yes, I've never had a problem finding a
way to do that in the IDEs I've used.
Since I'm a command-line guy myself, I'm just displaying my ignorance
in this area.


The command line is the way to go, especially since so many early C tutorial
programs work best when you redirect input from a file, which is a bit
tricky in some IDEs.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jun 28 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: enki | last post by:
I have been learning perl and C++, and I have been looking into Java. I know very little about the language, I have found some realy bad books that realy served to confues me and I have to find...
0
by: James Messick | last post by:
I'm just getting started with MySQL. Got my first db created and can run SQL against it in the phpAdmin program. Is there a tutorial online somewhere that shows me the basics of accessing it from a...
2
by: Kurien Baker Fenn | last post by:
I would like to show the progress of an application using the progress bar in visual basics using the timer.Please help me. Thanks in advance.
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
1
by: ThunderMusic | last post by:
Hi, I need to send some data from my app to a remote server. So, after some searches, I found the best way would be to use web services (unless you can suggest me other ways). The data sent will...
5
by: Jyoti Khalap | last post by:
HI Can Anyone help me out with my problem its very urgent I want to import text file to my visual basics application because everytime its a new text file depending on that text file i want to...
3
Mague
by: Mague | last post by:
Hey, I need help to some how open a exe file with Microsoft Visual basics. You mite think im trying to steal someone elses project but im not i wont to no how they did it and upgrade it if...
0
by: babu8880 | last post by:
www.convensysglobal.com/elearn You can login and attend courses and similar resources ask your doubts from experienced engineers in iphone and Objective C Domain You can attend live classes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.