Jump to content

Recommended Posts

Evolution is natural - death of some and creation of others.

 

As you're aware, English is simply an amalgam of many ancient and more contemporary languages.

 

Besides, it's all okay as long as we don't adopt 'American English' (whatever that is??!!) or, Saints preserve us, damnable French! lol.gif ;\)

Link to post
Share on other sites
 Quote:
Originally posted by Retired Morris Dancer:
Go on, give us an example of this C++!
This is one of my favorite PHP modules, the Kakasi extension lets you convert between kanji/hiragana/katakana/romaji on the fly. Here's the first few lines:


static char *php_kakasi_argv_wakati[] = {"kakasi", "-w"};
static const int php_kakasi_argn_wakati = sizeof(php_kakasi_argv_wakati)/sizeof(char*);

function_entry kakasi_functions[] = {
PHP_FE(kakasi, NULL)
PHP_FE(kakasi_asort, first_arg_force_ref)
PHP_FE(kakasi_arsort, first_arg_force_ref)
PHP_FE(kakasi_asorti, first_arg_force_ref)
PHP_FE(kakasi_arsorti, first_arg_force_ref)
PHP_FE(kakasi_split, NULL)
{NULL, NULL, NULL}
};


oops, this looks like C, not C++...
Link to post
Share on other sites

here is an algorythm writen in C

#include < stdio.h>

#include < math.h>

 

void main()

{

int angle_degree;

double angle_radian, pi, value;

 

/* Print a header */

printf ("\nCompute a table of the sine function\n\n");

 

/* obtain pi once for all */

/* or just use pi = M_PI, where

M_PI is defined in math.h */

pi = 4.0*atan(1.0);

printf ( " Value of PI = %f \n\n", pi );

 

printf ( " angle Sine \n" );

 

angle_degree=0; /* initial angle value */

/* scan over angle */

 

while ( angle_degree <= 360 ) /* loop until angle_degree > 360 */

{

angle_radian = pi * angle_degree/180.0 ;

value = sin(angle_radian);

printf ( " %3d %f \n ", angle_degree, value );

 

angle_degree = angle_degree + 10; /* increment the loop index */

}

}

 

nothing special in here, just some sin fuction computations for angles

Link to post
Share on other sites
×
×
  • Create New...