Hi all,

Just a general question, if someone asks you to provide

a) description of source code
b) how to run the program

how do you write this? I'm currently taking a C programming course as a beginner and these were ask of me to do. Any help would be much appreciated.

Rick

a) Source code is kind of like a programming code.

b) First type your code in a complier such as Dev c++, Turbo C, VC++, ect. Then you compile it. Done!

Siripong153,

Thanks for the response, but can you elaborate on the source code writing abit more? For example, if I wrote a code like this, what do I say about my source code?

//Enter a number for x

#include <stdio.h>
int main(void)
{
int x;
printf("Enter a number: ");
scanf("%d",&x);
printf("X is %d\n, x");
return 0;
}

source code is not "kind of like a programming code"... source code IS the programming code. it's the entire .c file and everything in it that you wrote.

so if you want to describe it, then just write -- in plain words and simple sentences -- what your code actaully does. example:

the program prompts the user to input a number. it waits for the user to type a number and press enter, then it .... etc etc etc

how to run the program? that depends on how you present the program to your audience (ie your instructor)... since, i assume you are handing in the source code, they will have to compile it. so include compile instructions. here's an example if you use Linux/Unix machines:

copy the file "myprogram.c" to your local folder, then change directory to that folder and type the command: "gcc -o myprogram myprogram.c" ...

to describe the process of running the program, think what steps do you (or the user) have take to get the compiled program to actually start up.

thats it


.

That's clearer of what need to be written. Yes, I have to hand in my source code structure and it's assignment.

Thanks for the suggestion, Jepthah. I'm using MS Visual C++ 2005 Express Edition

I'm using MS Visual C++ 2005 Express Edition

then, of course, you will change the compile description to match how you do it in MSVC. the command line instruction, for instance, is simply

cl myprogram.c

This article has been dead for over six months. Start a new discussion instead.