Search Amazon.com:
Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
  • Post
  • Reply
Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.


It only wouldn't work if the array based string contained \0 in a nonterminal position.

Just write your own string comparison routine. Like AD says, it's not hard. If that's too much trouble take the length of the null terminated string and stop whining. You probably don't need the extra speed anyway.

Adbot
ADBOT LOVES YOU

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.


Maybe strings aren't the best data structure. Look at ropes maybe?

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.


Schweinhund posted:

Is there an easier way to write this?

if (times_i_went_to_the_store == 3 ||
times_i_went_to_the_store == 5)
{
do whatever;
}

code:
switch(times_i_went_to_the_store) {
  case 3:
  case 5:
    do whatever;
}

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.


If you are forced to duplicate documentation stupidly you could always write a script to extract the doxygen comments from the pair of files and run them through diff to at least let you know when they've gone out of sync.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply