Author |
Message |
Guest
Offline
|
Posted: Thu Oct 20, 2005 11:56 am Post maybe stupid Post subject: |
|
|
|
|
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: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Oct 20, 2005 1:53 pm Post maybe stupid Post subject: |
|
|
|
|
I think they're probably just typos _________________
|
|
Back to top |
|
|
Assassin2684+ Guest
Offline
|
Posted: Thu Oct 20, 2005 2:06 pm Post maybe stupid Post subject: |
|
|
|
|
Ya your probably right. |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Thu Oct 20, 2005 3:53 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Oct 20, 2005 4:04 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Thu Oct 20, 2005 4:11 pm Post maybe stupid Post subject: |
|
|
|
|
Awww, you're no fun. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Oct 20, 2005 5:52 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Fri Oct 21, 2005 12:55 am Post maybe stupid Post subject: |
|
|
|
|
windows doesn't have a write() function? boo |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Oct 21, 2005 4:07 pm Post maybe stupid Post subject: |
|
|
|
|
Of course it does, but that's not very platform-independent. (And Windows is hard to deal with anyway.) |
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sat Oct 22, 2005 1:23 pm Post maybe stupid Post subject: |
|
|
|
|
I think printf is easier to use than cout |
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Sat Oct 22, 2005 1:26 pm Post maybe stupid Post subject: |
|
|
|
|
can't printf objects |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sat Oct 22, 2005 7:14 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
Quan Chi2 Member of "Sexy Teenagers that Code" Group
Age:33 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Sat Oct 22, 2005 7:59 pm Post maybe stupid Post subject: |
|
|
|
|
hey does objects include sound effects? |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Oct 23, 2005 10:45 am Post maybe stupid Post subject: |
|
|
|
|
@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 |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Oct 23, 2005 4:12 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
SamHughes Server Help Squatter
Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Sun Oct 23, 2005 7:51 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Oct 23, 2005 8:15 pm Post maybe stupid Post subject: |
|
|
|
|
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 |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Oct 23, 2005 8:47 pm Post maybe stupid Post subject: |
|
|
|
|
I believe outputting \a makes a beep |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
|
Back to top |
|
|
|