title: Code::Blocks iostream.h file missing?
body: <p>I'd like to implement the following code.  However, there is no iostream.h in my MinGW/include directory.  </p>
  
  <p>I found this code online, and I would like to use it to automate my lab.</p>
  
  <p>Another question, what is .dsw file and how would I leave it running?</p>
  
  <p>Thanks!</p>
  
  <pre><code>/*
  
  
    This program was written in Microsoft VC++ 6.0 Standard Edition.  It demonstrates
    use of SCPI commands to communicate with Keithley 2400 sourcemeter with GPIB interface.
  
    It makes use of the CEC488 driver for Keithley GPIB cards: KPCI-488, KPC-488.2 or KPC-488.2AT
  
    Please verify proper operation of the GPIB card by use of the TRTEST.exe utility program
    located typically in the \Program Files\CEC488 folder.  Use it to send *IDN? to the instrument
    and then read back (enter command) 50 bytes from the instrument.  If TRTEST.exe can 
    communiate with your SourceMeter, this program will work too.
  
    Be sure to open the workspace file, 2400.dsw, to run this example.
  
  
  */
  #include "ieee-cpp.h"
  #include "iostream.h"
  #include "stdlib.h"
  #include "stdio.h"
  #include "string.h"
  #include "time.h"
  
  void wait (int seconds)
  {
     clock_t endwait;
     endwait = clock () + seconds * CLK_TCK;
     while (clock () &lt; endwait) {}
  }
  
  int main ()
  {
      int status,device,l,i,k=0,h=0,poll;
     long g;
     char c, r[85], sout[1000], choice = 0;
  
     settimeout (2000);   //changes timeout period from default of 10 secs to 2 secs
  
  start:   
     cout &lt;&lt; endl;
     cout &lt;&lt; endl;
     cout &lt;&lt; "This program was written for the Keithley 2400 SourceMeter Series.";
     cout &lt;&lt; endl;
     cout &lt;&lt; endl;
     cout &lt;&lt; "What is the address of the 24xx SourceMeter to be used?  ";
     cin &gt;&gt;device;
     cout &lt;&lt; endl;
  
     initialize (0,0);   // Initializes the GPIB system
  
     system ("cls");      //clears screen
  
     send (device,":*rst",&amp;status);  // reset the instrument
     send (device,":OUTP:STAT OFF",&amp;status);  // make sure the output is OFF
  
  
  //   Test to see if device is present
     spoll (device,&amp;poll,&amp;status);   //reads status of device
     if (status == 0)
     {
        printf("Device found at Address %d is ready \n \n",device);
        send (device,"*idn?",&amp;status);     
        enter (r,100,&amp;l,device,&amp;status);
        g=strlen(r);   //number of characters in string not including null character
        i=0;      //zeros the counter
        printf("You will be using a: \n \n");
        while (i&lt;g)
        {
           while (r!=',')
           {
              printf("%c",r);      //prints KEITHLEY INSTRUMENTS INC.
              i++;
           }
           printf(" , ");
           i++;
           while (r!=',')
           {
              printf("%c",r);      //prints MODEL 24##
              i++;
           }
           i++;
           cout &lt;&lt; endl;
           cout &lt;&lt; endl;
           cout &lt;&lt; "SN# is: ";
           while (r!=',')
           {
              cout &lt;&lt; ("%c",r);      //prints serial number
              i++;
           }
           i++;
           cout &lt;&lt; endl;
           cout &lt;&lt; endl;
           cout &lt;&lt; "Firmware revision,date and time / Display board / Analog board / Digital board";
           cout &lt;&lt; endl;
           while ((r!=',') &amp;&amp; (i!=g))
           {
              printf("%c",r);
              i++;
           }
           cout &lt;&lt; endl;
           cout &lt;&lt; endl;
  
        }
  
  answer:
        cout &lt;&lt; endl;
        cout &lt;&lt; "Is this the correct multimeter 'y' or 'n'?  ";
        cin &gt;&gt; choice;
           if ((choice=='y')||(choice=='Y'))
           {
              system ("cls");
              goto loop;
           }
           if ((choice=='n')||(choice=='N'))
           {
              system ("cls");
              goto start;
           }
        cout &lt;&lt; "You did not enter a valid option. Please try again or EXIT \n \n";
        goto answer;
     }
     if (status !=0)
     {
        system ("cls");
        printf("No device present or device not communicating at address %d \n \n \n",device);
        printf("This program was written for Keithley GPIB cards.  Verify \n");
        printf("operation of your Keithley GPIB card using the trtest.exe program\n");
        printf("\n \n \n");
        goto start;
     }
  
     system ("cls");
  
  loop:
  
     cout &lt;&lt; endl;
     cout &lt;&lt; endl
  //      &lt;&lt; "Enter 'i' to identify particulars of device at address "&lt;&lt;device&lt;&lt; ".\n"
        &lt;&lt; "Enter 'c' to measure current.\n"
        &lt;&lt; "Enter 's' to sweep voltage (1-2 VDC) and measure current.\n"
  //      &lt;&lt; "Enter 't' to test code. \n"
        &lt;&lt; "Enter 'v' to measure applied DC volts up to 10 volts.\n"
        &lt;&lt; "Enter 'm' to communicate with new meter.\n"
        &lt;&lt; "Enter 'q' to EXIT program.\n"
        &lt;&lt; "Enter choice: ";
     cin &gt;&gt; choice;
     cout &lt;&lt; endl
        &lt;&lt; endl;
  
  /*//////////////////////////////////////////////////////////////*/
  
     if((choice=='i') || (choice=='I'))
     {
        //  Below identifies connected device at address ??
        send (device,":*rst",&amp;status);
        send (device,"*idn?",&amp;status);     
        enter (r,85,&amp;l,device,&amp;status);    
        printf("You are using a %s \n \n",r);
        cout &lt;&lt; endl;
        goto loop;
     }
  
  /*//////////////////////////////////////////////////////////////*/
  
     if((choice=='s') || (choice=='S'))
     {
        //   Below source volts &amp; measure current sweep
        send (device,":*rst",&amp;status);
        send (device,":TRAC:CLE",&amp;status);
        send (device,":TRAC:POIN 11",&amp;status);
        send (device,":SENS:FUNC:CONC OFF",&amp;status);
        send (device,":SOUR:FUNC VOLT",&amp;status);
        send (device,":SOUR:CLE:AUTO ON",&amp;status);
        send (device,":SENS:FUNC 'CURR:DC'",&amp;status);
        send (device,":SENS:CURR:PROT 0.1",&amp;status);
        send (device,":SOUR:VOLT:START 1",&amp;status);
        send (device,":SOUR:VOLT:STOP 2",&amp;status);
        send (device,":SOUR:VOLT:STEP 0.1",&amp;status);
        send (device,":SOUR:VOLT:MODE SWE",&amp;status);
        send (device,":TRIG:COUN 11",&amp;status);
        send (device,":FORM:ELEM VOLT,CURR",&amp;status);
        send (device,":TRAC:FEED:CONT NEXT",&amp;status);
        send (device,":OUTP:STAT ON",&amp;status);
        send (device,":INIT",&amp;status);
        wait(2);   //# of seconds delay to allow data to be stored
        send (device,":TRAC:DATA?",&amp;status);
        enter (sout,1000,&amp;l,device,&amp;status);
  
        g=strlen(sout);   //number of characters in string not including null character
        i=0;      //zeros the counter
        printf("     Volts         Current\n");
        printf("     -----         -------\n");
        while (i&lt;g)
        {
           while (sout!=',')
           {
              printf("%c",sout);
              i++;
           }
           printf(" , ");
           i++;
           while ((sout!=',') &amp;&amp; (i!=g))
           {
              printf("%c",sout);
              i++;
           }
           i++;
           cout &lt;&lt; endl;
        }
        cout &lt;&lt; endl;
        goto loop;
     }
  
  /*//////////////////////////////////////////////////////////////*/
  
     if((choice=='t') || (choice=='T'))
     {
        //   Below is the code test section
        for(c=0;c&lt;5;c++)
           printf(" %d\n %d\n",2*c,2*c+1);
  //      printf(" , ");
  //      for(k=0;k&lt;10;k++)
  //         printf("%d",k);
        cout &lt;&lt; endl;
        cout &lt;&lt; endl;
        goto loop;
     }
  
  /*/////////////////////////////////////////////////////////////*/
  
     if((choice=='v') || (choice=='V'))
     {
        //   Below measures volts DC
        send (device,":*rst",&amp;status);
        send (device,":SOUR:FUNC VOLT",&amp;status);
        send (device,":SOUR:VOLT:MODE FIX",&amp;status);
        send (device,":SOUR:VOLT:RANG 10",&amp;status);
        send (device,":SOUR:VOLT:LEV 0",&amp;status);
        send (device,":SENS:FUNC 'VOLT'",&amp;status);
        send (device,":SENS:VOLT:NPLC 10",&amp;status);
        send (device,":SENS:CURR:PROT 0.105",&amp;status);
        send (device,":SENS:CURR:RANG 0.105",&amp;status);
        send (device,":FORM:ELEM VOLT",&amp;status);
        send (device,":OUTP:STAT ON",&amp;status);
        send (device,":INIT",&amp;status);
        send (device,":READ?",&amp;status);
        enter (r,30,&amp;l,device,&amp;status);
        printf("The voltage is %s VDC \n",r);
        cout &lt;&lt; endl;
        send (device,":OUTP:STAT OFF",&amp;status);
        goto loop;
     }
  
  /*/////////////////////////////////////////////////////////////*/
  
     if((choice=='c') || (choice=='C'))
     {
        //   Below measures current DC
        send (device,":*rst",&amp;status);
        send (device,":SOUR:FUNC VOLT",&amp;status);
        send (device,":SOUR:VOLT:MODE FIX",&amp;status);
        send (device,":SOUR:VOLT:RANG 10",&amp;status);
        send (device,":SOUR:VOLT:LEV 0",&amp;status);
        send (device,":SENS:FUNC 'CURR'",&amp;status);
        send (device,":SENS:CURR:NPLC 10",&amp;status);
        send (device,":SENS:CURR:PROT 1",&amp;status);
        send (device,":SENS:CURR:RANG 1",&amp;status);
        send (device,":FORM:ELEM CURR",&amp;status);
        send (device,":OUTP:STAT ON",&amp;status);
        send (device,":INIT",&amp;status);
        send (device,":READ?",&amp;status);
        enter (r,30,&amp;l,device,&amp;status);
        printf("The current is %s Amps \n",r);
        cout &lt;&lt; endl;
        send (device,":OUTP:STAT OFF",&amp;status);
        goto loop;
     }
  
  /*//////////////////////////////////////////////////////////////*/
  
     if((choice=='m') || (choice=='M'))
     {
        initialize (0,0);   // Initialize the GPIB system
        send (device,":*rst",&amp;status);
        send (device,":OUTP:STAT OFF",&amp;status);
        system ("cls");
        goto start;
  //      return 0;
     }
  
  /*//////////////////////////////////////////////////////////////*/
  
     if((choice=='q') || (choice=='Q'))
     {
        initialize (0,0);   // Initialize the GPIB system
        send (device,":*rst",&amp;status);
        send (device,":OUTP:STAT OFF",&amp;status);
        return 0;
     }
  /*//////////////////////////////////////////////////////////////*/
  
     cout &lt;&lt; "You did not enter a valid option. Please try again or EXIT \n \n";
        goto loop;
  
    return 0;
  }
  </code></pre>