GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Aug-2005, 19:56
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Post

Re: Porting code from C++ to PHP


I just posted a GID Community blog entitled: Porting code from C++ to PHP.

Quote:
Chapter Two : Random Dispersion Array PHP

Now that there is some working (C++) code that shows how to create a random dispersion array it is time to make the crossing. Perhaps this was how the explorers felt when sailing into the unknown. They knew how to sail, but didn't know what was in store for them over the horizon. Well, even if they didn't, it's sure how I felt. read more...

Please let me know what you think.

This is an auto-generated message posted by GIDNetwork™ on behalf of the author.
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #2  
Old 03-Aug-2005, 04:46
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
There is an error in the code I missed,

PHP Code:

function BuildRndList( &$IDarray, $size, $OtherIDs, $OtherIDamt ){

  $rndASpubID = array_fill( 0, $size, 0 ); #error
  for ( $i = 1; $i <= $OtherIDs; $i++ ) {
    for ( $j = 0; $j < $OtherIDamt; $j++) { 



should of course read,

PHP Code:

function BuildRndList( &$IDarray, $size, $OtherIDs, $OtherIDamt ){

  $IDarray = array_fill( 0, $size, 0 ); #thats better
  for ( $i = 1; $i <= $OtherIDs; $i++ ) {
    for ( $j = 0; $j < $OtherIDamt; $j++) { 



Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #3  
Old 03-Aug-2005, 17:19
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 858
admin will become famous soon enough
Hehehe... I will make the necessary edits soon
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Guidelines for posting requests for help - UPDATED! WaltP C++ Forum 0 21-Apr-2005 02:44
need php code fix leegold MySQL / PHP Forum 1 04-Mar-2005 07:07
Problem with int mixed with char,... leitz C++ Forum 17 07-Dec-2004 20:56
Parsing PHP code that's stored in a database. JdS MySQL / PHP Forum 3 13-May-2004 09:15

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:41.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.