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
C++ > * > VB
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic Printable version
 View previous topic  Not Pron Post :: Post Coolest Avatar Award 2005  View next topic  
Author Message
Guest



Offline

PostPosted: Thu Oct 20, 2005 11:56 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Well mabye I made the mistakes because I typed it all out. I guess I will look over it..
Back to top
D1st0rt
Miss Directed Wannabe


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

PostPosted: Thu Oct 20, 2005 1:53 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I think they're probably just typos
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Assassin2684+
Guest


Offline

PostPosted: Thu Oct 20, 2005 2:06 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Ya your probably right.
Back to top
Mr Ekted
Movie Geek


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

PostPosted: Thu Oct 20, 2005 3:53 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Donkano wrote:
Ya, but isn't it required for that script, as it handles the cout comand?


That was the point I was making.
_________________
4,691 irradiated haggis!
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: Thu Oct 20, 2005 4:04 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Four, actually, and one of them was more than a type. You use <iostream> but referenced cout and endl without a namespace.

And don't be so mean and vague, Ekted. What he's saying, Donkano, is that the real way to do it is actually via printf(), a reasonably simple function that is practically built in to the OS (or at least a heck of a lot closer than the iostream classes are).
_________________
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
Mr Ekted
Movie Geek


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

PostPosted: Thu Oct 20, 2005 4:11 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Awww, you're no fun. icon_smile.gif
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: Thu Oct 20, 2005 5:52 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I wasn't willing to actually compile it. I just eyeballed it.
_________________
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
Bak
?ls -s
0 in


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

PostPosted: Fri Oct 21, 2005 12:55 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

windows doesn't have a write() function? boo
Back to top
View users profile Send private message Add User to Ignore List AIM Address
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: Fri Oct 21, 2005 4:07 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Of course it does, but that's not very platform-independent. (And Windows is hard to deal with anyway.)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
D1st0rt
Miss Directed Wannabe


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

PostPosted: Sat Oct 22, 2005 1:23 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I think printf is easier to use than cout sa_tongue.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Bak
?ls -s
0 in


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

PostPosted: Sat Oct 22, 2005 1:26 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

can't printf objects
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


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

PostPosted: Sat Oct 22, 2005 7:14 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Bak wrote:
can't printf objects


You can't cout objects either without each object having its own serialization code, which is the same as adding custom code with printf.
Back to top
View users profile Send private message Add User to Ignore List
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:33
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Sat Oct 22, 2005 7:59 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

hey does objects include sound effects?
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
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 Oct 23, 2005 10:45 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

@Ekted: How would you add custom code to printf() without recompiling the CRT? Wouldn't you have to rewrite printf() in your own app?
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 Oct 23, 2005 4:12 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I don't mean IN the printf code, I mean just have a function that takes an "object", and printf's the desired info. It's exactly the same with C++, just hidden.
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: Sun Oct 23, 2005 6:18 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Cyan~Fire wrote:
Four, actually


There's more than meets the eye!

Code: Show/Hide
#include <iostream>
#include <stdlib.h

int main(int argc. char *argv[])
(
   cout << "Hello, I am your computer talking." << endl;
   system("PAUSE");
   returm 0;
)


1. #include <stdlib.h (not to mention deprecation)
2. argc.
3. ( instead of {
4. cout instead of std::cout
5. endl instead of std::endl
6. returm
7. ) instead of }

3 and 7, and 4 and 5 are the same errors really, but still, that makes at least five.

8. In "Hello, I am your computer talking.", the computer's not really talking. :-)
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


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

PostPosted: Sun Oct 23, 2005 7:51 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

it looks nice to be able to do on one line

cout << "obj1: " << obj1 << ", obj2: " << obj2 << endl;

instead of having to memorize the functions for the diifferent objects and using multiple lines (although I suppose you could give your objects a print() function):

printf("obj1: ");
printObject(obj1);
printf(", obj2: ");
printDifferentObject(obj2);
printf("\n");

but these are small apples in either case.

what do I need to #include for write() in Windows?
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mr Ekted
Movie Geek


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

PostPosted: Sun Oct 23, 2005 8:15 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

There's a low-level function in the RTL called _write(). The include file is io.h. But I wouldn't normally use this. I like fwrite/fputs. The actual Windows function is called WriteFile(), but you really shouldn't use the OS-specific calls for run-time things unless you REALLY need to optimize.
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 Oct 23, 2005 8:47 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I believe outputting \a makes a beep
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
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 Oct 23, 2005 8:56 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Ekted wrote:
but you really shouldn't use the OS-specific calls for run-time things unless you REALLY need to optimize.

And the run-time library stuff is a lot easier to use than Windows.

What I was trying to say before is that without extra work you can't really do
Code: Show/Hide
printf("Hi, %s, your stats are %o.", name, stats);
. Yes, the C++ version is just a bunch of different function calls and it is nicer just to have one, but in this specific case I do think the C++ way wins out.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Goto page Previous  1, 2, 3
Page 3 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 cannot 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: 644 page(s) served in previous 5 minutes.

phpBB Created this page in 0.772762 seconds : 45 queries executed (83.9%): GZIP compression disabled