Results 1 to 10 of 10

Thread: Question about source code editing.

  1. #1
    Strato
    Guest

    Question about source code editing.

    I am new to linux and "source code" can anyone explain to me what exactly source code looks like and a program that i can write it with on linux. Please dont be harsh im a n00b
    ???

  2. #2

    Re:Question about source code editing.

    it looks like a C of boogers.;D if you are curious as to nuts and bolts, go to sourceforge and download the source code to a program. then just look into the files. all the source is is an uncompiled version of the program. it isn't installable the way it is. the source is literalyl from the authors hand. once you compile it, with such programs as gcc or whatever, it has been translated to machine code. machine code is stuff your PC can digest. FYI, linux is entirely built on C. you can write a C program in such apps as vi or pico. honestly, and i am not flaming you here, if you don't know what a source looks like, how will you write one? do you know C? hope this helps a bit

    Goodluck,

    Babbing

  3. #3
    JimH
    Guest

    Re:Question about source code editing.

    Ok here goes. Source code is all of the instructions in their original form of a particular programming language that makes up a program.

    The usual "hello world" example C++ source code

    // begin hello world C++
    #include <iostream>
    using namespace std;

    int main(void) // Yes "void" not needed. Just an old habit.
    {

    cout << "hello world" << endl;
    return 0;
    }
    // end hello world C++

    Before you can run a C++ program you have to "compile" it or convert it into the language your computer can understand.

    If the code above was saved to a file named hello.cc, you could compile it on a linux box with:

    g++ -Wall -o hellworld hello.cc

    If you want to learn how to program you need to get yourself a book on the language you wish to learn.

    Jim H


  4. #4

    Re:Question about source code editing.

    hmm, make does it, but why do you need the -Wall?
    just out of curiosity
    i have always just used gcc <in> -o <out>
    whatdoyougetwhenyoumultiplysixbynine??

  5. #5
    Aaron_Adams
    Guest

    Re:Question about source code editing.

    You don't need -Wall but it's somewhat of a standard in compilation of programs. If you make a program you will notice the the gcc commands all use -Wall.

    All it does is add in all of the extra warning options, that warn against usage that is not recommended, or unsafe.

    $ man gcc
    has a good overview of all the of the different warning options if you're interested.

  6. #6
    JimH
    Guest

    Re:Question about source code editing.

    Quote Originally Posted by Aaron_Adams
    You don't need -Wall but it's somewhat of a standard in compilation of programs.
    Yeah, you don't need -Wall, but in my opinion it should be enabled as the default.

    Jim H

  7. #7
    Cooter
    Guest

    Re:Question about source code editing.

    Has anyone edited any source code to meet there own personal needs and thrown out the functions they don't need?

  8. #8

    Re:Question about source code editing.

    not unless it is my own.

  9. #9
    Aaron_Adams
    Guest

    Re:Question about source code editing.

    Has anyone edited any source code to meet there own personal needs and thrown out the functions they don't need?
    Yes. I compile everything from source, so the odd time I'll run into conflicts . A lot of the editing is just Makefiles, but I have gone in and edited the source of things before to fix problems. I find if anything the most commond problem is found in the header files.

  10. #10

    Re:Question about source code editing.

    actually, yes i have..... it was only changing one number, and compiling it was terrible - lots of depends, but in the end it went well
    whatdoyougetwhenyoumultiplysixbynine??

Similar Threads

  1. Understanding Netfilter source code
    By explorer in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 11-06-2007, 09:52 PM
  2. Windows Source Code Leaked
    By BurntAsh in forum Windows - General Topics
    Replies: 3
    Last Post: 02-13-2004, 05:46 PM
  3. Possible to get different object files from the same source code & toolchain?
    By josaiah in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 10-17-2002, 02:24 AM
  4. UT Source code
    By Gaenya in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 02-16-2002, 04:43 PM
  5. Source Code Based Distros
    By Panserbjorne in forum Linux - General Topics
    Replies: 3
    Last Post: 01-20-2002, 01:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •