Wednesday 28 March 2012

A function for the main file with doxygen,c programming

This is the function fu.c (I am worse at naming stuff ,sorry)

 ...................................................................................................


/*!
*
 * 
\see a4.c
*/

/**
 * \brief   The function is intended to alter the arrays as per the rule depending on the user input in the file b1.txt,Temporary arrays are internally generated and which holds the intermediate data ,eventually the content of the temporary array is transfered to the main array.And similar process is carried out in the next iteration
 *
 * \details   Three iterations are performed and at each iteration the corresponding number of characters in the user chosen card is provided in the array "co" which is utilised,The iteration eventually causes the desired card to arrive at the slot as premised.
 *
 *
 *
 *
 * @param a
 *  The <a href="en.wikipedia.org/wiki/Pointer"> pointer</a>  to an <a href="en.wikipedia.org/wiki/Array"> array</a> is passed here,the array content being the card list ,As the approach illustrates representation of datum of cards as a two one dimensional array rather than a single two dimensional array.
 *   The array holds one component of a two component list which uniquely identifies the card
 *  
 *  
 * @param d
 *   It represent a pointer to an array which holds the other half of the card representation parameter
 * @param co
 *   It also represents an array which is used to hold the length of the spoken word by the user which being indicated in the file b1.txt
 *   Only optional parameters are explicitly stated as such. The description
 *   should clarify the default value if omitted.
 *
 * @return
 *   No return is required as the pointer data is
 *   <a href="http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/topic/com.ibm.xlcpp8l.doc/language/ref/cplr233.htm"> passed by reference</a>
 */

void fu(char *a,char *d,char *co)
{char tmp1[9],tmp2[9];
char b[9];
int i=0,j=0,k=0,l=0;
char t;
for(k=0;k<3;k++)
{printf("--------------------------------------%d iteration\n",k);
for(i=0;i<co[k];i++)
{tmp1[8-i]=a[i];
tmp2[8-i]=d[i];

}


for(l=0,j=i;j<9;j++,l++)
{tmp1[l]=a[j];
tmp2[l]=d[j];
}
for(i=0;i<9;i++)
{a[i]=tmp1[i];
d[i]=tmp2[i];
printf("%c(%c)\n",a[i],d[i]);}

}
return;

}


No comments:

Post a Comment