On Fri, 2 Apr 1999, Shai S. Yahav wrote:

> new in linux and programming...sorry for the dumm questions..

thanks for the politeness... its been lacking recently :)

> where can i read about vi or any other editors on linux?

If you're familiar with DOS edit.com, or like editors, I'd really
recommend JOE (Joe's Own Editor)...  its similar, and the keys aren't too
difficult to learn.  Failing that, even Pine is easier than vi.

vi's great for 'experts' though... it gets things done really quickly,
especially over lagged telnet connections.  Back from the "good old days",
many Unix gurus will tell you that "*real* men use vi".

Unfortunately I don't have any URLs for you.

> i tried to compile test.c and i got an error msg Undefined reference to
> 'main'
> how can i define 'main'? what is 'main'??

When your program is started, a procedure called main is called.  This is
so that your program actually *does* something, instead of just being a
collection of functions and procedures, and datatype declarations.

main is of type int, and can take two (optional) arguments, usually called
argc, and argv (the standard names given to a variable amount of
arguments.  argc is an int with the number of arguments given, argv is an
array of char*  (do you know about pointers?) being the list of arguments.
argv[0] is how the program was called.

Examples:

#include <stdio.h>

int main(int argc, char *argv[])
{
        printf("I am %s", argv[0]");
        for (int i = 0; i < argc; i++)
        {
                printf("Arg #%d is %s", i, argv[i]);
        }
}

or simply:

#include <stdio.h>
int main()
{
        printf("Hello, world\n");
}

> if u have any url about C (programming,compiling..) please send me the
> url.

Unfortunately, I don't..  but as I recall there are a few links on Yahoo.
In my own experience, reading other peoples source code has always been my
best tool for learning a new language, referring to references when
unsure on things, and reading FAQs for finer 'tuning'.

Good luck,

Gaven

------------------------------------------------------------------------
Gaven Cohen aka Kinslayer                         http://wastelands.net/
[EMAIL PROTECTED]                      hkp://keys.pgp.com/0x2042AD07
freelance sysadmin/programmer          linux, fantasy, female enthusiast
------------------------------------------------------------------------
 RSA/1024: fingerprint 79 BC B3 3F E2 05 71 4B  F7 C8 B2 45 EF 70 55 D1


Reply via email to