C# Convert Class with C++ and others






1.16/5 (11 votes)
May 28, 2004
1 min read

55036

490
ConvertTo,Math,Stack Classes to make your life easy with C++ 6.0
Introduction
Using:
to use this LIB Past it in your solution folder .and in the VC++6.0 menu(project ->Settings)
in the Link Tab in (object/library modules)box put the name of the lib like that(CSharp.lib)
and then add the header files in your project workspace with add file to project and then include the name of the header file in your cpp file like this
#include "Math.h";
I think all fuction are clear and have the same names in C++ and C#.
But i will discuss them
--------------------------------------------------------------------------------
Class Cconvert that have all basic data types convertion like (int,double,float,long,byte,bool,Cstring )
Cconvert x;int i=19; x.ToDouble(i); x.ToString (i,4); //4 mean the digits number that you want to apear to user //and so on...
--------------------------------------------------------------------------------
Class CIntStack that take integer and put them in stack that encrease dinamicaly
CIntStack s; s.Push(6); s.Push(7); s.GetCount() ; //get the number of stack Elements. Int buff=s.Pop();//buff =7; buff= s.Pop();//buff=6; buff=s.Pop();//buff=-1;
And you will find also CstringStack and CdoubleStack that have the same functions
--------------------------------------------------------------------------------
Class CMath tha have all math fuctions that we need plus some functions ..
CMath m; m.Round(9.6); m.Ceil(8.6); m.Sin(2.7);//takes radians m.SinD(90);//takes Degree; m.Mean(arr,size);//get the mean of array; m.Median (arr,size);//get the Median of array; m.Sort(arr,10);//Sort integer and double arrays and take the size of array m.LinearSearch(arr,key,size);//key to be search with it and take double too; m.BinarySearch(arr,key,size);//this function call sort function frist to sort the array ,and //take double m.GetMaxInArray(arr,size);//get the max number in array int or double , m.GetMaxIndexInArray(arr,size);//get the index that have the max number. m.GetMax(var1,var2,var3);//get the max between three numbers and also two number. ///and you will find also GetMin functions like GetMax;and all regular math function //that you will need.
I Hope you like it please Send me if there any problems