Just post it, and we'll post a solution. It won't necessarily be the solution to your specific problem, but better than nothing, right?
Name:
Anonymous2008-11-25 11:08
Just post it, and we'll post a solution series of ENTERPRISE-QUALITY memes. They won't necessarily be the solution to your specific problem, but better than nothing, right?
Name:
Anonymous2008-11-25 11:14
I have to write "Hello World!" to the command prompt, how?
Name:
Anonymous2008-11-25 11:32
Here's the program: #include <stdio.h>
int main (int argc, char ** argv) {
printf("Hello World!\n");
return 0;
}
Here's a step by step explanation:
#include <stdio.h>
This statement lets the compiler know about the standard input/output functions (e.g. reading and writing to command prompt, reading and writing to files). Without it, the compiler won't recognize these functions and will not be able to use them.
int main (int argc, char ** argv)
This is the signature of the main function. The first word, int, indicates that this function returns an integer (I'll explain why later). The second word, main, gives the name of the function. Every C program must have a main function, that's where the program starts. The two things in parentheses are parameters. They're the information given to function. For main, the operating system always passes two parameters to it, argc and argv. Together they represent the command line arguments to the program when run from the command prompt. It isn't really something you need to worry about now, just remember to put them in when you write main.
{
}
The braces indicate that the code which they surround is the body of the thing immediately preceding them. So the code in the braces is the body of main.
printf("Hello World!\n"); printf is C's command prompt writing function. It takes a string (series of letters) and prints it. It can also take variables and print them, but you don't need to worry about that yet. Also, notice the \n? That simply creates a new line. Without it, when someone runs your program, this will happen: C:\blah\>hello.exe
Hello World!C:\blah\>
Doesn't look very good, does it? Remember to terminate output with a new line!
return 0;
Remember earlier when I said that main returns an integer? This is it. The operating system wants to know whether the program completed successfully or not, so we return an integer code to it. 0 is success, any other number is failure. Usually we choose one number for each potential point of error, so that if there is a problem we can look at the number and find out what the error is. But a program this simple shouldn't have any errors so no need to consider that sort of thing.
If you have any other questions feel free to ask :-)
>>6
Obviously you didn't run the program. cmd.exe puts a new line for you.
Name:
Anonymous2008-11-25 12:48
>>6 I'M EXIT_SUCCESS
SON OF A BITCH 0
0 IS PIG
DO YOU WANT POSIX
DO YOU WANT ANONIX PROGRAMMING GUIDELINES
KERNIGHAN IS FUCKING DISGUSTING
RITCHIE IS A MURDERER
FUCKING K&R
>>9
Worst KOREAN clone ever. Damn you people, what's up with your meme pasting skills? Learn the fucking right version:
I'M <adjective>
SON OF A BITCH <name>
<name> IS PIG
DO YOU WANT <feature 1>?
DO YOU WANT <feature 2>?
<name> IS PIG DISGUSTING
<full person name> IS A MURDERER
FUCKING <alternative name>
(lambda (a b c d e f)
(string-append "I'M " a "\nSON OF A BITCH " b "\n" b " IS PIG\nDO YOU WANT " c "\nDO YOU WANT " d "\n" b "IS PIG DISGUSTING\n" e " IS A MURDERER\nFUCKING " f))
Name:
Anonymous2008-11-25 17:38
>>13 I'M <adjective> I AM <noun>
There, I fixed it for you.
Name:
Anonymous2008-11-25 19:26
hello, real OP here (check the address if you want)
the homework involves C and POSIX system calls, signals, and whatnot.
as I said before, I need to use C with linux POSIX functions and stuff to define and share memory and semaphores.
two programs: anonymous and mods
'anonymous' allows persons to talk to mods. if there is a mod, communication is established
'mods' allows a mod to establish communication with anonymous, one at a time.
The communication between the anonymous and mods programs is done through shared memory. It is suggested that the communication takes place in alternating order, ie:
The program anonymous reads a line of stdin (using fgets), puts it into memory (using the size of fgets), then mods program reads the information via shared memory and writes it to its stdout. Then, 'mods' reads a line of stdin, puts it in shared memory and program 'anonymous' reads the information via shared memory and writes it to its stdout, and so on. Users of any of the programs may indicate who want to end the communication through the indication of end of file.
These programs should include the concurrent implementation of various 'mods' programs and various 'users' programs.
Name:
Anonymous2008-11-27 7:34
gonna give an example:
zsh$ anonymous
"What is your anonymous reference?" 6969
"waiting for connection"
"connected with Moot" Moot help me out
"I want to be the little girl" Dude ur fucking useless
"I know lol" sigh
zsh$ mods
"talking with 6969"
"Moot help me out" I want to be the little girl
Dude ur fucking useless I know lol
sigh
(...)
"talking with 10821"
Name:
Anonymous2008-11-27 7:38
Moot is not useless you moron. protip: if somebody is being an insufferable faggot, please e-mail me.
Sounds trivial. Either use mmap[1] or a subset of System V IPC[2], assuming you are running a kernel which supports these features. You could probably come up with a solution just by searching Google for five minutes.
>>23
Moot is a fucking dickbutt. He never posts in the boards I visit, and probably doesn't even give a damn that his whole site is slow like a snail these days.
Name:
Anonymous2008-11-27 7:50
>>23
You must be new.
Every time moot tries to do something, things change from bad to worse.