#define DEBUG
#include <iostream> 
using namespace std;

  
#ifndef DEBUG
   #define ASSERT(x)
#else
   #define ASSERT(x) \
         if (! (x)) \
         { \
            cout << "ERROR!! Assert " << #x << " failed" << endl; \
            cout << " on line " << __LINE__  << endl; \
            cout << " in file " << __FILE__ << endl;  \
         }
#endif

#ifndef DEBUG
#define DPRINT(string)
#else
#define DPRINT(STRING) cout<< #STRING;
#endif


int main()
{
 long x, z, n, y = 0, u , v;
 long ze[100];
 
cout << " write an integer : ";
cin >> x; 
ASSERT(y == 0);
DPRINT(...00000...);cout <<__DATE__<< endl;
cin.ignore(); 
    for(n = x; n > 0; n /= 2)	
	 {
      z = n % 2; 
      ze[y] = z;
      y++;                 
     }
    cout << " Binary representation : "<< endl;
    u = y - 1;
    while(u >= 0)
	 {
      cout << ze[u] ;
      u--;
      if ((u + 1) % 4 == 0 )
        cout << " ";
     } 
	
	cout <<" \n Check result , hexadecimal version of " << x <<" is :\n ";
     cout << endl << hex << x << endl;


  // turn the binary into an hexadecimal number by using every 4 digits ... 
  int i = 0, w = 1, val = 0, j = 0;
  u = 0;
  long hex[100];
  
  
  while( u <= (y - 1) )
    {
      for(i = 0; i < 4 ; ++i) 
       {
		   val = (ze[u] * (w))+ val;
		   if (u < y)
	        {   
				cout << "\n val = "<< val << endl;
		    }		
			if ((i == 3)&& (u < y))
			{
				cout << endl << val << " hello "<< endl;
				hex[j] = val; j++;
			}
			else if (u == (y - 1))  // && ( i != 0)
			{
				cout << endl << val << " bye " << endl;
				hex[j] = val; j++; u = y;
			} 
		 w = w * 2;
		 u++; 
       }
     i = 0;
	 val = 0;
	 w = 1;
    } 
  
  
  cout << '\n';
  //v = j - 1;
  
  for( v = j - 1; v >= 0; --v)
	 {
      cout << hex[v] ;
	  if(hex[v]== 10)cout << 'A';
	  if(hex[v]== 11)cout << 'B';
	  if(hex[v]== 12)cout << 'C'; 
	  if(hex[v]== 13)cout << 'D';
	  if(hex[v]== 14)cout << 'E';
	  if(hex[v]== 15)cout << 'F';
     } 
 

     char zs;cin>>zs;
}   

Doubly linked list (4 files)

C++ again, for finding one root of a third degree equation and checking the result , it often works fine :

For finding the 93 first Fibonacci numbers very fast , after 93 iterations it is false :

A linked list for practising :

For finding the binary representation of a number using bits :

For finding the binary representation of a number using maths :

hexadecimal representation of a number using maths :

hexadecimal representation of a number using bits :

for well understanding the structure of a linked list, here is a simple one:

It was a long and difficult linked list, but apparently, it works. Below are some other pages of code in C++, exercises most of the time. I have also put some of my plugins for 3dsmax.

I learned maxscript before learning C++, here are some scripts or plugins I did:

Next, there is some linear algebra and funny matrices:

This is now a script for enciphering and deciphering messages.

Here is an example of enciphered message. If I tell you that the 2 primes are 431 and 743 , with my script above you surely can translate the following message: 62520 172480 147764 226702 42110 58127 123996 256203 196716 181614 299597 181614 241357 187604 32762 17311 309478 29630 301116 153664 113777 14703

C++LANGUAGE
 
basicperson.h
aperson.h
aperson.cpp
ofstream.cpp
 
 
 
 
maxplugins
 
thirddegree.cpp
 
fibonacci.cpp
 
linkedlist.cpp
 
binary1
 
binary2
 
BACKHOME
 
hex1
 
hex2
 
simpleLinkedList
 
determinantmatrix
 
QRdecomposition
 
cryptography