Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Learning C++...
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  NTFS to FAT32 converter? Post :: Post Administrative Control Panel  View next topic  
Author Message
Solid_Fire
Server Help Squatter


Age:34
Gender:Gender:Male
Joined: Dec 22 2004
Posts: 327
Location: NV. Dont stalk me..plz..
Offline

PostPosted: Sun Jan 23, 2005 1:57 am    Post subject: Learning C++... Reply to topic Reply with quote

I just started reading a tutorial at www.cplusplus.com and try to learn it.

Can anyone give me some examples and tips on how to get better at this and how to create test program to make sure i understand and practice of that? i have Miracle C as a compiler. Any kind of help would be great.
_________________
Unknown Webmaster, Confused Game Player
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger
Chambahs
Guest


Offline

PostPosted: Sun Jan 23, 2005 10:21 am    Post subject: Reply to topic Reply with quote

i tried learning C++, but i quit, its too complicated...good luck
Back to top
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Jan 23, 2005 11:21 am    Post subject: Reply to topic Reply with quote

The best way to learn a language is to make something in it. Just try thinking of some idea.

The material on that site is enough to learn in general. If you have sepcific questions, I'll be glad to answer them.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Solid_Fire
Server Help Squatter


Age:34
Gender:Gender:Male
Joined: Dec 22 2004
Posts: 327
Location: NV. Dont stalk me..plz..
Offline

PostPosted: Sun Jan 23, 2005 2:18 pm    Post subject: Reply to topic Reply with quote

ok, first question i have is that i know "cout" is the output right? and when i do examples in Miracle C it gives me an error saying

Code: Show/Hide
Miracle C Compiler (r3.2), written by bts.
line   3: #include iostream.h ignored--file not found.
Compiling C:\Program Files\Miracle C\test.c
main

C:\Program Files\Miracle C\test.c: line 7: variable 'cout' not found
'<< "Hello World!"'
aborting compile


here is the example :

Code: Show/Hide
// my first program in C++

#include <iostream.h>

int main ()
{
  cout << "Hello World!";
  return 0;
}



I don't understand why it is saying that, maybe its the program im using?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Jan 23, 2005 2:33 pm    Post subject: Reply to topic Reply with quote

Your code is C++ indeed, but are you sure that "Miracle C Compiler" supports C++?
Also, you should let code files with C++ code in them have the extension .cpp.

I think it should be

Code: Show/Hide
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}


or

Code: Show/Hide
#include <iostream>

int main ()
{
  std::cout << "Hello World!";
  return 0;
}


but this would burn Ek's eyes.

For a decent and free IDE with a compiler supporting C++ (I think it uses MingW or something) try Bloodshed Dev-C++.


Last edited by Solo Ace on Sun Jan 23, 2005 2:40 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Jan 23, 2005 2:36 pm    Post subject: Reply to topic Reply with quote

It already has. I am typing blind now...

If you want to learn C++ forget iostreams. Learn C first. That will give you syntax, data structures, etc. Then learn OOP concepts after.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Jan 23, 2005 2:41 pm    Post subject: Reply to topic Reply with quote

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

int main(int argc, char *argv[])
{
    printf("Hello World!");
    return 0;
}


like that?

edit: GAH, wrong import (thats what you get for writing java programs)
_________________



Last edited by D1st0rt on Sun Jan 23, 2005 2:52 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Jan 23, 2005 2:46 pm    Post subject: Reply to topic Reply with quote

N0b.
Quote:
helloworld.cpp(5) : error C3861: 'printf': identifier not found, even with argument-dependent lookup


#include <stdio.h>

sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Jan 23, 2005 3:13 pm    Post subject: Reply to topic Reply with quote

Hey Ek, read my uber Qndre-style code.

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

int main(int argc, char *argv[])
{
   system("echo Hello World!");
   return 0;
}
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Jan 23, 2005 3:13 pm    Post subject: Reply to topic Reply with quote

What did you have before? "import Java.lang;"? sa_tongue.gif

Bah! Stupid replies before I reply!

No, Qndre style code would be

Code: Show/Hide
#include <string>

class MyApp : CWinApp
{
private:
   static char hello_world = "Hello world!";
};

MyApp myapp;

BOOL MyApp::InitInstance()
{
   string mystring("echo ");
   mystring += "hello_world;

   system(mystring);

   return TRUE;
}


Hmm, I wonder if I remembered my MFC correctly...
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Solid_Fire
Server Help Squatter


Age:34
Gender:Gender:Male
Joined: Dec 22 2004
Posts: 327
Location: NV. Dont stalk me..plz..
Offline

PostPosted: Sun Jan 23, 2005 5:24 pm    Post subject: Reply to topic Reply with quote

ok, so can someone write out an example program so i can practice it and learn the basics of a C++ and C program?

PLus, i tried DL bloodshed and i use Windows ME, not Win 98,95 or XP (if it runs XP)

So i tried looking for Visual Basic, but didnt know if it was for C++ or for something else. Said Service Pack 6.

I'll keep looking for more C++ Compilers that are easy to work with.


(20-10 Eagles Winning YEA)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Jan 23, 2005 5:42 pm    Post subject: Reply to topic Reply with quote

Lies, that'd be 2hard4qndre, and the concept is the same anyway. sa_tongue.gif

Just download Bloodshed's Dev-C++ for Win95/98, ME almost is the same anyway.
Visual Basic is not for C++, please forget that name NOW.
If you really can't work with Dev-C++ get Microsoft Visual C++, it's good but not free though (for something that is free, check this thread).

You don't have many good options left if you give up on Dev-C++/MS VC++.

I never thought I'd recommend this site, many of the "code" sucks, just like most of the "programmers" (well, most don't deserve that title), anyway, Planet Sourcecode is some dump for newbies to show their code.
The "programs" there are mostly small, although most (yes, in this paragraph is the most used word is most) of the code is hard to read without restyling it.
Please, don't become one of them, don't put comments like "SUCK MY ... SCRIPTKIDIEZZ!!! cuz u CANT DO THIS IN VB LOlOloL!!" on top of your documents.

Also, on the website you found your tutorial, cplusplus.com are a few small example programs.

As Cyan said before in this thread, the best way to learn is just by trying to create something.
Start by trying to make something small, try to fix it for a while and when you can't figure something out, feel free to post your questions here.

I tried to start by reading the cplusplus.com tutorial, but since it was in English, and since I never saw any C++ code before, it was too vague. Just by trying to make programs, reading other's code and asking for help taught me more.


Last edited by Solo Ace on Sun Jan 23, 2005 5:58 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Jan 23, 2005 5:57 pm    Post subject: Reply to topic Reply with quote

Qndre style: http://quotes.ssforum.net/index.php?216

cyan: I had stdlib icon_rolleyes.gif


Last edited by D1st0rt on Sun Jan 23, 2005 7:58 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Jan 23, 2005 7:56 pm    Post subject: Reply to topic Reply with quote

LOL @ EVERYTHING! Good times.
Back to top
View users profile Send private message Add User to Ignore List
myke
Seasoned Helper


Gender:Gender:Male
Joined: Sep 11 2003
Posts: 142
Offline

PostPosted: Sun Jan 23, 2005 8:20 pm    Post subject: Reply to topic Reply with quote

http://petra.hos.u-szeged.hu/~aking/www.parinya.ca/

mingw developer studio, uses mingw and less bugs than dev-cpp
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:36
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Mon May 15, 2006 12:23 am    Post subject: Reply to topic Reply with quote

You know, I may not be the best person to help people with programming, but if you're having problems with learning to program from that website like I did, I would suggest buying a C++ book. They can be kinda expensive, so I'd suggest buying one used off of Amazon or something. I personally had a hard time trying to learn from websites. What Cyan said is definitely right, if you don't work with the language, you aren't going to remember it. I got through 400 pages of my C++ book and was into all kinds of things, and I can't even remember the names anymore.
I would suggest either Sam's Teach Yourself C++ In 21 Days by Jesse Liberty, or Ivor Horton's book, I think it's called Beginning C++. The Sam's book may be written by someone else now, since I think my version (fourth edition) is slightly old. Ivor Horton's book is probably a bit harder, but any idiot should be able to understand both, it spells it out pretty cleanly. Although, if I'm the spokesman for these books, it probably doesn't mean much. =x They are both very thorough, though, and you wouldn't be disappointed with them.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon May 15, 2006 2:03 am    Post subject: Reply to topic Reply with quote

can you get a program compiling?
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon May 15, 2006 4:27 am    Post subject: Reply to topic Reply with quote

Moved thread from "ASSS Custom Projects" to "Non-Subspace Related Coding" since it didn't metion asss once (unitl now of course).
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue May 16, 2006 12:43 pm    Post subject: Reply to topic Reply with quote

Am I the only one that noticed the ridiculous bump? (Tipped off by the Qndre references)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue May 16, 2006 10:28 pm    Post subject: Reply to topic Reply with quote

Not the only one... but I just figured MGB would delete the posts and any reply I made commenting on it would just end up deleted.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Thu May 25, 2006 1:12 pm    Post subject: Reply to topic Reply with quote

imho, this is a much better C++ learning site than cplusplus.com ...

http://www.ibiblio.org/obp/thinkCS/cpp/english/
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Thu May 25, 2006 1:24 pm    Post subject: Reply to topic Reply with quote

That site sucks.
Back to top
View users profile Send private message Add User to Ignore List
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Fri May 26, 2006 3:36 pm    Post subject: Reply to topic Reply with quote

if u like the m$ option u can get microsoft c++ express here (its free)

http://msdn.microsoft.com/vstudio/express/visualc/

If you are making windows apps (not console) you would do well to download the windows SDK as well.

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

I have found Dev-C++ much much easier to use than c++ express and visual c 6 but im a noob at c and c++ i havnt written anything over like 20 lines.

All the online "lessons" i've seen in c++ teach you the essentials of programming (which is the same for all languages) but not how to code in c++. I think the only way i will ever learn is if force myself to code some stuff in it, but c# is so easy - especailly with all those managed libs icon_smile.gif[/b]
Back to top
View users profile Send private message Add User to Ignore List
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 251
Location: Greenwich
Offline

PostPosted: Tue May 30, 2006 9:21 pm    Post subject: Reply to topic Reply with quote

Ekted, why do you hate iostreams?
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue May 30, 2006 9:33 pm    Post subject: Reply to topic Reply with quote

Because he has a mistaken view of how it works (link).

Mr Ekted wrote:
Use of iostreams and strings = more CPU cycles = more heat on whatever processor you choose.


At least, thats the reason he gives. I expect he actually had a bad experience and is taking the trauma out on us icon_smile.gif

NOTE: not spellchecked
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 625 page(s) served in previous 5 minutes.

phpBB Created this page in 0.506758 seconds : 50 queries executed (90.8%): GZIP compression disabled