Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 20th, 2006, 6:29 PM   #11
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
C# is the problem i used to program in C++ fluently! now for the last 6-8 months it has been C# every day because of work! After these months i relized i was loosing touch with the C++ purist inside of me! Now i want to take a series of DLL's i have written in C# and convert them to C++ to get back into the flow. And i apologize for cursing it is a bad bad hait i am attempting to break.

@Jimbo: thanks for the fix... i remeber now! I wasn't even thinking that i should specify the class the contructor belongs to.

EDIT:

still haev one unresolved question... why is it i cannot return a string array!?!?!?!?!?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old May 20th, 2006, 7:10 PM   #12
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Quote:
Originally Posted by Kilo
still haev one unresolved question... why is it i cannot return a string array!?!?!?!?!?
http://www.programmingforums.org/for...ead.php?t=9115
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote
Old May 21st, 2006, 8:21 AM   #13
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,107
Rep Power: 5 lectricpharaoh will become famous soon enough
Quote:
Originally Posted by Kilo
@lectricpharaon: would this work ->
[php]
int len = sizeof(script)/sizeof(script[0]);
[/php]
For getting the count of elements in script, if it is allocated statically (by this I mean at compile time, not necessarily static as opposed to auto), it should. If you instead allocate dynamically, then sizeof(script) will be the size of a pointer on the system in question (likely four bytes), and not the size of the allocated block.

I agree with previous suggestions to use vectors. Syntactically, they may be different from C# arrays (never used C#, though I hear it's very Java-esque), but semantically, they are likely quite similar. Thus, any changes in the code to accomodate this will be fairly minor, and it will allow you to keep it conceptually closer to the C# code.
Quote:
Originally Posted by Kilo
still haev one unresolved question... why is it i cannot return a string array!?!?!?!?!?
You can. The catch is, if you return an array from a function, odds are it gets deallocated before the calling function can use it (assuming it is declared in the called function). You can either a) allocate it off the heap with new, b) make it static, or c) return a container (like a vector).
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:12 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC