Server Help

Bot Questions - Learning C

Anonymous - Fri Feb 01, 2008 7:23 am
Post subject: Learning C
I'm trying to learn C in an attempt to make plugins for MERVBot.

Where do I begin? I have Dev C++ and I've downloaded and looked at the source of MERVBot, but it all looks like a bunch of jibberish. I've also checked out a few C tutorials, but nothing seems to help me understand.

Can anyone point me in the right direction?
Animate Dreams - Fri Feb 01, 2008 12:19 pm
Post subject:
Um, The C tutorials would be the right direction you're looking for. I really don't know how to get any more basic than that. I believe http://www.cplusplus.com has tutorials, you might want to check those out.
Samapico - Fri Feb 01, 2008 1:18 pm
Post subject:
Yeah, read some cplusplus.com before attempting to make plugins. Once you get used to the language, you can try to understand the structure of a MERV plugin.
Anonymous - Fri Feb 01, 2008 1:30 pm
Post subject:
Samapico wrote:
Yeah, read some cplusplus.com before attempting to you can try to understand the structure of a MERV plugin.

I have a feeling that's going to be the hardest part.

Any tips for the future?
tcsoccerman - Fri Feb 01, 2008 3:42 pm
Post subject:
you caqn also try the help file in devcpp. it's at help menu in the menustrip.
Anonymous - Fri Feb 01, 2008 6:31 pm
Post subject:
I'm having a terrible time getting anything to work in Dev-C++. When I go to compile even the simplest program from a tutorial, it gives me a write "Error 1".

I don't know what the hell happened to it, but it used to work fine.

Can you recommend any other programs?
CypherJF - Fri Feb 01, 2008 6:57 pm
Post subject:
Error 1?

Could you copy the compile logs?
Anonymous - Fri Feb 01, 2008 7:59 pm
Post subject:
Sure, here.

Code: Show/Hide
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Owner\Desktop\C++\Makefile.win"
Executing  make...
make.exe -f "C:\Documents and Settings\Owner\Desktop\C++\Makefile.win" all
g++.exe -c Untitled1.cpp -o Untitled1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   

Untitled1.cpp:1:10: #include expects "FILENAME" or <FILENAME>
Untitled1.cpp:2: error: expected unqualified-id before '<' token
Untitled1.cpp:2: error: expected `,' or `;' before '<' token

make.exe: *** [Untitled1.o] Error 1

Execution terminated

CypherJF - Fri Feb 01, 2008 8:03 pm
Post subject:
And your Untitled1.cpp file?

Obviously, it's pointing at line 10; something you have with your #include statement isn't what it's expecting.
Anonymous - Fri Feb 01, 2008 8:45 pm
Post subject:
Ok, well.. I copied it directly from a tutorial and it says it's a working program.

See here: http://www.cprogramming.com/tutorial/c/lesson1.html

Code: Show/Hide
#include
<stdio.h>

int main()
{
  printf( "I am alive!  Beware.\n" );
  getchar();
  return 0;
}


and yes, Untitled1.cpp.
tcsoccerman - Fri Feb 01, 2008 8:55 pm
Post subject:
i don't know if this is how it is in the file, but try having

#include <stdio.h>

instead of

#include
<stdio.h>
Anonymous - Fri Feb 01, 2008 9:40 pm
Post subject:
Heh, that did it.

Thanks a lot.

I'm gonna take a look at the tutorials you guys posted and if I have any more questions, I will post here.
Animate Dreams - Wed Feb 06, 2008 5:37 pm
Post subject:
Yeah... anything that begins with # is a preprocessor or precompiler directive iirc, and all directives like that have to be on one line, and aren't ended with semicolons. It's not really being compiled, it's translated before the actual compilation. Just FYI.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group