Jump to content

  • Log In with Google      Sign In   
  • Create Account

Endemoniada

Member Since 01 Jul 2003
Offline Last Active Jun 11 2013 12:18 AM
-----

#5062670 How would you concatenate an array of strings together?

Posted by Endemoniada on 17 May 2013 - 03:53 PM

 

char buffer[4096]; // adjust
buffer[0]='\0';
 
for(int i=0;i<array_size;i++){
strcat(buffer,string_array[i]);
}

 

You can implement a two pass system as well, the first pass can determine how big the buffer must be.

I want to provide constructive criticism to say why you are getting downvotes, because it is frustrating to receive a negative reputation with out explanation.

That is the wrong language; there is no strcat() that I'm aware of in C#, and character arrays are not what is being used. That's also one of the least efficient ways to concatenate a collection of strings, due to having to count the length of the buffer each time you concatenate the string, which takes longer and longer.

 

Thank you. I didn't see the C# icon until just now.




#5061190 How would you concatenate an array of strings together?

Posted by Endemoniada on 11 May 2013 - 07:04 PM

char buffer[4096]; // adjust
buffer[0]='\0';
 
for(int i=0;i<array_size;i++){
strcat(buffer,string_array[i]);
}

 

You can implement a two pass system as well, the first pass can determine how big the buffer must be.




#4956183 Catalog of Particle Effects ?

Posted by Endemoniada on 05 July 2012 - 08:20 PM

Hi guys,

Do you know of any catalogs of different types of particle effects so I can learn how they are made ? I made a little engine and editor and the stuff I'm coming up with doesn't look very professional. I know it's a complex subject but I'm just trying to make cool looking stuff for an essentially 2D game, I'm not necessarily looking for realism either.

One thing I'm running into is the effects I make look decent on one colored background (like gold) but not another (like blue). The different levels in my game will have different colored backgrounds so this is disheartening.

Any help would be appreciated. Thanks.


PARTNERS