<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[EXE aus (veraltetem?) C++ Code erstellen]]></title><description><![CDATA[<p>Hallo allerseits.</p>
<p>Ich habe eigentlich nichts mit C++ zu tun, programmiere eigentlich nur in Java, und entschuldige mich, falls ich mein Thema im falschen Abteil erstellt habe.</p>
<p>Derzeit schreibe ich in Java ein Programm mit dem man Curriculum basierte Stundenpläne erstellen und optimieren kann. Vor 2 Tagen habe ich angefangen, mein Programm für eine neue Probleminstanz anzupassen. Normalerweise ist für eine Probleminstanz immer eine ausführbare EXE-Datei dabei, die den erstellten Stundenplan bewertet. Dieser dient nur zur Überprüfung, ob das eigene Bewertungssystem funktioniert (Abgleich).</p>
<p>Lange Rede kurzer Sinn. Für meine neue Probleminstanz ist keine ausführbare EXE-Datei, sondern nur folgender Code aus der Datei <em>checksln.cpp</em> dabei:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;iostream.h&gt;
#include &lt;math.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;fstream.h&gt;
#include &lt;string.h&gt;

main(int argc, char * argv[])
{
int norooms,nostudents, noevents;
int nofeatures;

bool *  * roomfeatures;
bool * * eventfeatures;
int * roomsizes;
int * eventrooms;
int * eventslots;
bool * * attends;       //attends[event][student]
bool * * studentavailability;        //studentavailability[slot][student]
int * eventtypes;
char filename[100];
char timfilename[100];
char slnfilename[100];

if(argc!=2){cout&lt;&lt;&quot;Usage: checksln filename&quot;&lt;&lt;endl;cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);exit(0);}
sscanf(argv[1],&quot;%s&quot;,&amp;filename);

int len = strlen(filename);

strcpy(timfilename,filename) ;
timfilename[len]='.';
timfilename[len+1]='t';
timfilename[len+2]='i';
timfilename[len+3]='m';
timfilename[len+4]='\0';

strcpy(slnfilename,filename) ;
slnfilename[len]='.';
slnfilename[len+1]='s';
slnfilename[len+2]='l';
slnfilename[len+3]='n';
slnfilename[len+4]='\0';

ifstream tim;
tim.open(timfilename);
if (!tim ) {
		  cout&lt;&lt; &quot;Couldn't open the file &quot;&lt;&lt;timfilename&lt;&lt;endl;
		  cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
		  exit(1);
		}

tim&gt;&gt;noevents;
tim&gt;&gt;norooms;
tim&gt;&gt;nofeatures;
tim&gt;&gt;nostudents;

roomsizes = new int[norooms];
eventrooms = new int[noevents];
eventslots = new int[noevents];
eventtypes = new int[noevents];

roomfeatures = new bool*[norooms] ;
for(int i=0;i&lt;norooms;i++) roomfeatures[i] = new bool[nofeatures];

eventfeatures = new bool*[noevents] ;
for(int i=0;i&lt;noevents;i++) eventfeatures[i] = new bool[nofeatures];

attends = new bool *[noevents];
for(int t=0;t&lt;noevents;t++)attends[t] = new bool [nostudents];

studentavailability = new bool *[45];
for(int i=0;i&lt;45;i++) studentavailability[i]=new bool[nostudents];

for(int i=0;i&lt;norooms;i++)tim&gt;&gt;roomsizes[i];

for(int i=0;i&lt;nostudents;i++)for(int j=0;j&lt;noevents;j++)tim&gt;&gt;attends[j][i];

for(int i=0;i&lt;norooms;i++)for(int j=0;j&lt;nofeatures;j++)tim&gt;&gt;roomfeatures[i][j];
for(int i=0;i&lt;noevents;i++)for(int j=0;j&lt;nofeatures;j++)tim&gt;&gt;eventfeatures[i][j];

tim.close();
ifstream sln;
sln.open(slnfilename);

if (!sln) {
		  cout&lt;&lt; &quot;Couldn't open the file &quot;&lt;&lt;slnfilename&lt;&lt;endl;
		  cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
		  exit(1);
		}
long unplaced=0;
long endofday=0;
for(int i=0;i&lt;noevents;i++)
	{
	sln&gt;&gt;eventslots[i]&gt;&gt;eventrooms[i];
	if ((eventslots[i])== -1)cout&lt;&lt;&quot;Event &quot;&lt;&lt;i&lt;&lt;&quot; does not have a timeslot assigned&quot;&lt;&lt;endl;
	if ((eventrooms[i])== -1)cout&lt;&lt;&quot;Event &quot;&lt;&lt;i&lt;&lt;&quot; does not have a room assigned&quot;&lt;&lt;endl;
	if (((eventrooms[i])== -1)||    ((eventrooms[i])== -1)) unplaced++ ;
   }
sln.close();

long unsuitablerooms=0;
for(int e=0;e&lt;noevents;e++)
	{
   int size =0;
   bool badroom=false;
   for(int g=0;g&lt;nostudents;g++)if(attends[e][g])size++;
   if((eventrooms[e]!=-1)&amp;&amp; (roomsizes[eventrooms[e&rsqb;&rsqb;&lt;size))
   	{
      cout&lt;&lt;&quot;Event &quot;&lt;&lt;e&lt;&lt;&quot; requires a room of size &quot;&lt;&lt;size&lt;&lt;endl;
      cout&lt;&lt;&quot;It has been assigned a room (&quot;&lt;&lt;eventrooms[e]&lt;&lt;&quot;) of size &quot;&lt;&lt;roomsizes[eventrooms[e&rsqb;&rsqb;&lt;&lt;endl;
      badroom=true;
      }
   for(int f=0;f&lt;nofeatures;f++)
   	if((eventrooms[e]!=-1)&amp;&amp;eventfeatures[e][f]&amp;&amp;!roomfeatures[eventrooms[e&rsqb;&rsqb;[f])
      	{
         cout&lt;&lt;&quot;Event &quot;&lt;&lt;e&lt;&lt;&quot; requires feature &quot;&lt;&lt;f&lt;&lt;endl;
      	cout&lt;&lt;&quot;It has been assigned a room (&quot;&lt;&lt;eventrooms[e]&lt;&lt;&quot;) without feature &quot;&lt;&lt;f&lt;&lt;endl;
      	badroom=true;
      	}
   if(badroom)unsuitablerooms++;
   }

long studentclashes=0;
long roomclashes=0;
for(int i=0;i&lt;nostudents;i++)for(int e=0;e&lt;45;e++)studentavailability[e][i]=true;

for(int g = 0; g&lt;nostudents;g++)
   for(int e=0;e&lt;noevents;e++)
   	{
   	for(int f=0;f&lt;e;f++)
   		if((eventslots[e]!=-1)
         	&amp;&amp;(eventslots[f]!=-1)
         	&amp;&amp;attends[e][g]
            &amp;&amp;attends[f][g]
         	&amp;&amp;eventslots[e]==eventslots[f])
         		{
            	cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has to attend both event &quot;&lt;&lt;e&lt;&lt;&quot; and event &quot;&lt;&lt;f&lt;&lt;&quot; in slot &quot;&lt;&lt; eventslots[e]&lt;&lt;endl;
            	studentclashes++;
            	}
      if((eventslots[e]!=-1)&amp;&amp;attends[e][g])studentavailability[eventslots[e&rsqb;&rsqb;[g]=false;

      }

for(int e=0;e&lt;noevents;e++)
	for(int f=0;f&lt;e;f++)
   	if((eventslots[e]!=-1)
      	&amp;&amp;(eventslots[f]!=-1)
         &amp;&amp;(eventrooms[e]!=-1)
         &amp;&amp;(eventrooms[f]!=-1)
         &amp;&amp;(eventslots[e]==eventslots[f])
         &amp;&amp;(eventrooms[e]==eventrooms[f]))
      		{
         	cout &lt;&lt;&quot;Events &quot;&lt;&lt;e&lt;&lt;&quot; and event &quot;&lt;&lt;f&lt;&lt;&quot; both occur in slot &quot;&lt;&lt; eventslots[e]&lt;&lt;&quot; and room &quot;&lt;&lt;eventrooms[e]&lt;&lt;endl;
         	roomclashes++;
         	}
cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Number of unplaced events =&quot;&lt;&lt;unplaced&lt;&lt;endl;
cout &lt;&lt;&quot;Number of unsuitable rooms = &quot;&lt;&lt;unsuitablerooms&lt;&lt;endl;
cout &lt;&lt;&quot;Number of student clashes = &quot;&lt;&lt;studentclashes&lt;&lt;endl;
cout &lt;&lt;&quot;Number of room clashes = &quot;&lt;&lt;roomclashes&lt;&lt;endl&lt;&lt;endl;

long longintensive=0;
for(int g=0;g&lt;nostudents;g++)
	{

   for(int d=0;d&lt;5;d++)
   	{
      int count=0;

   	for(int t=0;t&lt;9;t++)
      	{
         int slot=d*9+t;
         if(studentavailability[slot][g]==false)count++;
         else count=0;
         if(count&gt;=3)
         	{
            cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has a set of three events up to slot &quot;&lt;&lt;slot&lt;&lt;endl;
            longintensive++;
            }
         }
      }
   }

 cout&lt;&lt;endl&lt;&lt;endl;
long single=0;
for(int g=0;g&lt;nostudents;g++)
	{
   for(int d=0;d&lt;5;d++)
   	{
      int count=0;
      int badslot=-1;
   	for(int t=0;t&lt;9;t++)
      	{
         int slot=d*9+t;
         if(studentavailability[slot][g]==false)
         	{
            count++;
            badslot=slot;
            }
         }
      if(count==1)
      	{
         cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot &quot;&lt;&lt;badslot&lt;&lt;&quot; which is the only one on that day&quot;&lt;&lt;endl;
            single++;
         }

      }
   }
for(int g=0;g&lt;nostudents;g++)
	{
    if(studentavailability[8][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 8 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[17][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 17 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[26][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 26 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[35][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 35 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[44][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 44 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    }
cout &lt;&lt;endl&lt;&lt;&quot;Penalty for students having three or more events in a row = &quot;&lt;&lt;longintensive&lt;&lt;endl;
cout &lt;&lt;&quot;Penalty for students having single events on a day = &quot;&lt;&lt;single&lt;&lt;endl;
cout &lt;&lt;&quot;Penalty for students having end of day events = &quot;&lt;&lt;endofday&lt;&lt;endl;

cout&lt;&lt;endl&lt;&lt;&quot;TOTAL PENALTY = &quot;&lt;&lt;(longintensive+single+endofday)&lt;&lt;endl&lt;&lt;endl;
if (unplaced+unsuitablerooms+studentclashes+roomclashes)cout&lt;&lt;&quot;This solution file does not give a complete and feasible timetable&quot;&lt;&lt;endl;
else    cout&lt;&lt;&quot;This solution file gives a complete and feasible timetable&quot;&lt;&lt;endl;

delete [] roomsizes;
delete [] eventrooms;
delete [] eventslots;
for(int t=0;t&lt;noevents;t++)delete[]attends[t];
delete [] attends;
for(int i=0;i&lt;45;i++)delete []studentavailability[i];
delete [] studentavailability;
delete []eventtypes;
for(int i=0;i&lt;nofeatures;i++)delete []roomfeatures[i];
delete []roomfeatures;
for(int i=0;i&lt;nofeatures;i++)delete []eventfeatures[i];
delete []eventfeatures;
cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
}
</code></pre>
<p>Ich bräuchte also eine ausführbare EXE-Datei dieses Codes. Ich habe mir heute Mittag <em>Bloodshed Dev-C++</em> geholt und installiert. Der Code kann soweit auch kompiliert und eine EXE-Datei erstellt werden, jedoch funktioniert die EXE-Datei insofern nicht, dass sie als Fehler ausgibt, die 2 benötigten Input-Dateien würden fehlen. Diese liegen aber im selben Ordner wie die EXE-Datei (laut Quelle soll es so auch sein). Und die 2 Inputdateien haben auch die benötigte Bezeichnung <em>filename.tim</em> und <em>filename.sln</em>.</p>
<p>Beim Kompilieren werden (wenn ich das richtig erkannt habe), folgende Warnungen ausgegeben:<br />
-C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31<br />
-#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.</p>
<p><strong>Der Code selbst ist sicherlich korrekt, und Fehlerfrei (Logik).</strong>. Nur denke ich dass er (Syntax) veraltet ist, und die heutigen Kompiler damit nicht klar kommen (meine wage Vermutung), aber ihr wisst das besser.<br />
Der Code stammt laut Quelle aus 2002. Und beim Googlen nach der Warnmeldung, habe gelesen, dass die Libraries oben veraltet seien, und es deshalb zu Fehlern kommen könnte.</p>
<p>Ich hoffe ihr könnt mir helfen das zum laufen zu bekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/264656/exe-aus-veraltetem-c-code-erstellen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Jul 2026 02:16:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/264656.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Apr 2010 18:20:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:27:36 GMT]]></title><description><![CDATA[<p>Hallo allerseits.</p>
<p>Ich habe eigentlich nichts mit C++ zu tun, programmiere eigentlich nur in Java, und entschuldige mich, falls ich mein Thema im falschen Abteil erstellt habe.</p>
<p>Derzeit schreibe ich in Java ein Programm mit dem man Curriculum basierte Stundenpläne erstellen und optimieren kann. Vor 2 Tagen habe ich angefangen, mein Programm für eine neue Probleminstanz anzupassen. Normalerweise ist für eine Probleminstanz immer eine ausführbare EXE-Datei dabei, die den erstellten Stundenplan bewertet. Dieser dient nur zur Überprüfung, ob das eigene Bewertungssystem funktioniert (Abgleich).</p>
<p>Lange Rede kurzer Sinn. Für meine neue Probleminstanz ist keine ausführbare EXE-Datei, sondern nur folgender Code aus der Datei <em>checksln.cpp</em> dabei:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;iostream.h&gt;
#include &lt;math.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;fstream.h&gt;
#include &lt;string.h&gt;

main(int argc, char * argv[])
{
int norooms,nostudents, noevents;
int nofeatures;

bool *  * roomfeatures;
bool * * eventfeatures;
int * roomsizes;
int * eventrooms;
int * eventslots;
bool * * attends;       //attends[event][student]
bool * * studentavailability;        //studentavailability[slot][student]
int * eventtypes;
char filename[100];
char timfilename[100];
char slnfilename[100];

if(argc!=2){cout&lt;&lt;&quot;Usage: checksln filename&quot;&lt;&lt;endl;cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);exit(0);}
sscanf(argv[1],&quot;%s&quot;,&amp;filename);

int len = strlen(filename);

strcpy(timfilename,filename) ;
timfilename[len]='.';
timfilename[len+1]='t';
timfilename[len+2]='i';
timfilename[len+3]='m';
timfilename[len+4]='\0';

strcpy(slnfilename,filename) ;
slnfilename[len]='.';
slnfilename[len+1]='s';
slnfilename[len+2]='l';
slnfilename[len+3]='n';
slnfilename[len+4]='\0';

ifstream tim;
tim.open(timfilename);
if (!tim ) {
		  cout&lt;&lt; &quot;Couldn't open the file &quot;&lt;&lt;timfilename&lt;&lt;endl;
		  cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
		  exit(1);
		}

tim&gt;&gt;noevents;
tim&gt;&gt;norooms;
tim&gt;&gt;nofeatures;
tim&gt;&gt;nostudents;

roomsizes = new int[norooms];
eventrooms = new int[noevents];
eventslots = new int[noevents];
eventtypes = new int[noevents];

roomfeatures = new bool*[norooms] ;
for(int i=0;i&lt;norooms;i++) roomfeatures[i] = new bool[nofeatures];

eventfeatures = new bool*[noevents] ;
for(int i=0;i&lt;noevents;i++) eventfeatures[i] = new bool[nofeatures];

attends = new bool *[noevents];
for(int t=0;t&lt;noevents;t++)attends[t] = new bool [nostudents];

studentavailability = new bool *[45];
for(int i=0;i&lt;45;i++) studentavailability[i]=new bool[nostudents];

for(int i=0;i&lt;norooms;i++)tim&gt;&gt;roomsizes[i];

for(int i=0;i&lt;nostudents;i++)for(int j=0;j&lt;noevents;j++)tim&gt;&gt;attends[j][i];

for(int i=0;i&lt;norooms;i++)for(int j=0;j&lt;nofeatures;j++)tim&gt;&gt;roomfeatures[i][j];
for(int i=0;i&lt;noevents;i++)for(int j=0;j&lt;nofeatures;j++)tim&gt;&gt;eventfeatures[i][j];

tim.close();
ifstream sln;
sln.open(slnfilename);

if (!sln) {
		  cout&lt;&lt; &quot;Couldn't open the file &quot;&lt;&lt;slnfilename&lt;&lt;endl;
		  cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
		  exit(1);
		}
long unplaced=0;
long endofday=0;
for(int i=0;i&lt;noevents;i++)
	{
	sln&gt;&gt;eventslots[i]&gt;&gt;eventrooms[i];
	if ((eventslots[i])== -1)cout&lt;&lt;&quot;Event &quot;&lt;&lt;i&lt;&lt;&quot; does not have a timeslot assigned&quot;&lt;&lt;endl;
	if ((eventrooms[i])== -1)cout&lt;&lt;&quot;Event &quot;&lt;&lt;i&lt;&lt;&quot; does not have a room assigned&quot;&lt;&lt;endl;
	if (((eventrooms[i])== -1)||    ((eventrooms[i])== -1)) unplaced++ ;
   }
sln.close();

long unsuitablerooms=0;
for(int e=0;e&lt;noevents;e++)
	{
   int size =0;
   bool badroom=false;
   for(int g=0;g&lt;nostudents;g++)if(attends[e][g])size++;
   if((eventrooms[e]!=-1)&amp;&amp; (roomsizes[eventrooms[e&rsqb;&rsqb;&lt;size))
   	{
      cout&lt;&lt;&quot;Event &quot;&lt;&lt;e&lt;&lt;&quot; requires a room of size &quot;&lt;&lt;size&lt;&lt;endl;
      cout&lt;&lt;&quot;It has been assigned a room (&quot;&lt;&lt;eventrooms[e]&lt;&lt;&quot;) of size &quot;&lt;&lt;roomsizes[eventrooms[e&rsqb;&rsqb;&lt;&lt;endl;
      badroom=true;
      }
   for(int f=0;f&lt;nofeatures;f++)
   	if((eventrooms[e]!=-1)&amp;&amp;eventfeatures[e][f]&amp;&amp;!roomfeatures[eventrooms[e&rsqb;&rsqb;[f])
      	{
         cout&lt;&lt;&quot;Event &quot;&lt;&lt;e&lt;&lt;&quot; requires feature &quot;&lt;&lt;f&lt;&lt;endl;
      	cout&lt;&lt;&quot;It has been assigned a room (&quot;&lt;&lt;eventrooms[e]&lt;&lt;&quot;) without feature &quot;&lt;&lt;f&lt;&lt;endl;
      	badroom=true;
      	}
   if(badroom)unsuitablerooms++;
   }

long studentclashes=0;
long roomclashes=0;
for(int i=0;i&lt;nostudents;i++)for(int e=0;e&lt;45;e++)studentavailability[e][i]=true;

for(int g = 0; g&lt;nostudents;g++)
   for(int e=0;e&lt;noevents;e++)
   	{
   	for(int f=0;f&lt;e;f++)
   		if((eventslots[e]!=-1)
         	&amp;&amp;(eventslots[f]!=-1)
         	&amp;&amp;attends[e][g]
            &amp;&amp;attends[f][g]
         	&amp;&amp;eventslots[e]==eventslots[f])
         		{
            	cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has to attend both event &quot;&lt;&lt;e&lt;&lt;&quot; and event &quot;&lt;&lt;f&lt;&lt;&quot; in slot &quot;&lt;&lt; eventslots[e]&lt;&lt;endl;
            	studentclashes++;
            	}
      if((eventslots[e]!=-1)&amp;&amp;attends[e][g])studentavailability[eventslots[e&rsqb;&rsqb;[g]=false;

      }

for(int e=0;e&lt;noevents;e++)
	for(int f=0;f&lt;e;f++)
   	if((eventslots[e]!=-1)
      	&amp;&amp;(eventslots[f]!=-1)
         &amp;&amp;(eventrooms[e]!=-1)
         &amp;&amp;(eventrooms[f]!=-1)
         &amp;&amp;(eventslots[e]==eventslots[f])
         &amp;&amp;(eventrooms[e]==eventrooms[f]))
      		{
         	cout &lt;&lt;&quot;Events &quot;&lt;&lt;e&lt;&lt;&quot; and event &quot;&lt;&lt;f&lt;&lt;&quot; both occur in slot &quot;&lt;&lt; eventslots[e]&lt;&lt;&quot; and room &quot;&lt;&lt;eventrooms[e]&lt;&lt;endl;
         	roomclashes++;
         	}
cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Number of unplaced events =&quot;&lt;&lt;unplaced&lt;&lt;endl;
cout &lt;&lt;&quot;Number of unsuitable rooms = &quot;&lt;&lt;unsuitablerooms&lt;&lt;endl;
cout &lt;&lt;&quot;Number of student clashes = &quot;&lt;&lt;studentclashes&lt;&lt;endl;
cout &lt;&lt;&quot;Number of room clashes = &quot;&lt;&lt;roomclashes&lt;&lt;endl&lt;&lt;endl;

long longintensive=0;
for(int g=0;g&lt;nostudents;g++)
	{

   for(int d=0;d&lt;5;d++)
   	{
      int count=0;

   	for(int t=0;t&lt;9;t++)
      	{
         int slot=d*9+t;
         if(studentavailability[slot][g]==false)count++;
         else count=0;
         if(count&gt;=3)
         	{
            cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has a set of three events up to slot &quot;&lt;&lt;slot&lt;&lt;endl;
            longintensive++;
            }
         }
      }
   }

 cout&lt;&lt;endl&lt;&lt;endl;
long single=0;
for(int g=0;g&lt;nostudents;g++)
	{
   for(int d=0;d&lt;5;d++)
   	{
      int count=0;
      int badslot=-1;
   	for(int t=0;t&lt;9;t++)
      	{
         int slot=d*9+t;
         if(studentavailability[slot][g]==false)
         	{
            count++;
            badslot=slot;
            }
         }
      if(count==1)
      	{
         cout &lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot &quot;&lt;&lt;badslot&lt;&lt;&quot; which is the only one on that day&quot;&lt;&lt;endl;
            single++;
         }

      }
   }
for(int g=0;g&lt;nostudents;g++)
	{
    if(studentavailability[8][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 8 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[17][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 17 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[26][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 26 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[35][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 35 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    if(studentavailability[44][g]==false)
   	{
   	cout&lt;&lt;&quot;Student &quot;&lt;&lt;g&lt;&lt;&quot; has an event in slot 44 which is at the end of a day&quot;&lt;&lt;endl;
      endofday++;
      }
    }
cout &lt;&lt;endl&lt;&lt;&quot;Penalty for students having three or more events in a row = &quot;&lt;&lt;longintensive&lt;&lt;endl;
cout &lt;&lt;&quot;Penalty for students having single events on a day = &quot;&lt;&lt;single&lt;&lt;endl;
cout &lt;&lt;&quot;Penalty for students having end of day events = &quot;&lt;&lt;endofday&lt;&lt;endl;

cout&lt;&lt;endl&lt;&lt;&quot;TOTAL PENALTY = &quot;&lt;&lt;(longintensive+single+endofday)&lt;&lt;endl&lt;&lt;endl;
if (unplaced+unsuitablerooms+studentclashes+roomclashes)cout&lt;&lt;&quot;This solution file does not give a complete and feasible timetable&quot;&lt;&lt;endl;
else    cout&lt;&lt;&quot;This solution file gives a complete and feasible timetable&quot;&lt;&lt;endl;

delete [] roomsizes;
delete [] eventrooms;
delete [] eventslots;
for(int t=0;t&lt;noevents;t++)delete[]attends[t];
delete [] attends;
for(int i=0;i&lt;45;i++)delete []studentavailability[i];
delete [] studentavailability;
delete []eventtypes;
for(int i=0;i&lt;nofeatures;i++)delete []roomfeatures[i];
delete []roomfeatures;
for(int i=0;i&lt;nofeatures;i++)delete []eventfeatures[i];
delete []eventfeatures;
cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
		  char key;
		  cin.get(key);
}
</code></pre>
<p>Ich bräuchte also eine ausführbare EXE-Datei dieses Codes. Ich habe mir heute Mittag <em>Bloodshed Dev-C++</em> geholt und installiert. Der Code kann soweit auch kompiliert und eine EXE-Datei erstellt werden, jedoch funktioniert die EXE-Datei insofern nicht, dass sie als Fehler ausgibt, die 2 benötigten Input-Dateien würden fehlen. Diese liegen aber im selben Ordner wie die EXE-Datei (laut Quelle soll es so auch sein). Und die 2 Inputdateien haben auch die benötigte Bezeichnung <em>filename.tim</em> und <em>filename.sln</em>.</p>
<p>Beim Kompilieren werden (wenn ich das richtig erkannt habe), folgende Warnungen ausgegeben:<br />
-C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31<br />
-#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.</p>
<p><strong>Der Code selbst ist sicherlich korrekt, und Fehlerfrei (Logik).</strong>. Nur denke ich dass er (Syntax) veraltet ist, und die heutigen Kompiler damit nicht klar kommen (meine wage Vermutung), aber ihr wisst das besser.<br />
Der Code stammt laut Quelle aus 2002. Und beim Googlen nach der Warnmeldung, habe gelesen, dass die Libraries oben veraltet seien, und es deshalb zu Fehlern kommen könnte.</p>
<p>Ich hoffe ihr könnt mir helfen das zum laufen zu bekommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880696</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:27:36 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:27:35 GMT]]></title><description><![CDATA[<p>Die Dateien müssen im Arbeitsverzeichnis liegen, nicht notwendigerweise im selben Verzeichnis wie die .exe.</p>
<p>Ich weiß jetzt nicht, wie du das Programm aufrufst, aber es klingt für mich so, als sei das beim Erstellen einer Verknüpfung oder so schiefgegangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880700</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:27:35 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:30:06 GMT]]></title><description><![CDATA[<p>Ich ruf die EXE direkt auf (Doppelklick). Und die liegt im selben Ordner wie meine 2 Input-Dateien.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880702</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:32:04 GMT]]></title><description><![CDATA[<p>Also ab hier will das Programm nicht mehr (siehe Quellcode oben zeile 28-30):</p>
<pre><code>if(argc!=2){cout&lt;&lt;&quot;Usage: checksln filename&quot;&lt;&lt;endl;cout&lt;&lt;&quot;Press return to continue&quot;&lt;&lt;endl;
          char key;
          cin.get(key);exit(0);}
</code></pre>
<p>Wie wenn beide Input Files nicht vorhanden wären.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880703</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:32:04 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:33:18 GMT]]></title><description><![CDATA[<p>Ah. In dem Fall ist das kein Wunder - das Programm erwartet den gemeinsamen Teil des Dateinamens als ersten Parameter. So, wie es das ja auch ausgibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880705</guid><dc:creator><![CDATA[seldon]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:38:08 GMT]]></title><description><![CDATA[<p>Ich weiß nicht ob das funktioniert, aber wenn ich den Code richtig verstehe, dann klick mal die Datei, die er nicht findet rechts an und öffne sie über &quot;öffnen mit&quot; mit dieser .exe .</p>
<p>mfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880706</guid><dc:creator><![CDATA[Magellan]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:38:08 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:40:37 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/23368">@Magellan</a><br />
Hm jetzt sagt er &quot;Couldn't open the file&quot; wie im Quellcode Zeile 56... Dateien sind aber korrekt.</p>
<p>Das steht noch in der Quelle drin:</p>
<blockquote>
<p>The program takes a command line parameter, the name of the file to check: filename.<br />
It expects to find in the current directory a problem file called filename.tim and a solution file filename.sln, produced by your algorithm in the format described in the Output Format section.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1880710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880710</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:40:37 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 18:50:16 GMT]]></title><description><![CDATA[<p>Demnach müsste es also funktionieren, wenn du in der Commandline den Pfad der Exe und nach einem Leerzeichen den Pfad der .tim / .sln Datei ohne die Endung eingibst.</p>
<p>Probier das bitte mal aus.<br />
Wenn in einem der Pfade Leerzeichen sind musst du sie in Anführungszeichen schreiben.</p>
<p>Wieder natürlich nur, wenn ich es diesmal verstanden habe ;).</p>
<p>Viel Glück</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880717</guid><dc:creator><![CDATA[Magellan]]></dc:creator><pubDate>Sat, 10 Apr 2010 18:50:16 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:06:52 GMT]]></title><description><![CDATA[<p>Pfad der EXE: c:\val\checksln.exe<br />
Pfad der Problemdatei: c:\val\problem.tim<br />
Pfad der Lösungsdatei: c:\val\solution.sln</p>
<p>Ich habe probiert:<br />
c:\val\checksln.exe c:\val\problem c:\val\solution<br />
bringt Fehler: Aus Zeile 28</p>
<p>Wenn ich nur eine der Dateien angebe<br />
bringt Fehler: Aus Zeile 56</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880722</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:10:44 GMT]]></title><description><![CDATA[<p>Ok, wenn ichs richtig verstanden hab, dann müssen problem und solution gleich heißen, sich also nur in der Dateiendung unterscheiden.</p>
<p>Dann musst du nur eine übergeben, also z.B. nennst du beide problem_solution.tim bzw. .sln<br />
dann rufst du auf:</p>
<p>c:\val\checksln.exe c:\val\problem_solution</p>
<p>das müsste dann gehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880725</guid><dc:creator><![CDATA[Magellan]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:10:44 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:16:25 GMT]]></title><description><![CDATA[<p>Ich glaube du liegst völlig richtig, sobald ich das ausführe arbeitet der PC kurz, dann aber kommt &quot;checksln.exe hat ein Problem festgestellt und muss beendet werden&quot;...</p>
<p>Ich mach mal einen Neustart und probiere es wieder. Bin gleich zurück...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880729</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:25:15 GMT]]></title><description><![CDATA[<p>Gut, sollte es dann weiterhin abstürzen, dann sind entweder deine .sln und .tim Dateien falsch aufgebaut, oder in diesen knapp 300 Codezeilen steckt irgendwo ein Fehler...</p>
<p>Ich schätze ja auf das erste, aber ich weiß es leider nicht...</p>
<p>Viel Glück noch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880732</guid><dc:creator><![CDATA[Magellan]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:25:15 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:26:13 GMT]]></title><description><![CDATA[<p>Ich werde alles nochmal überprüfen.</p>
<p>Vielen Dank für dein Hilfe...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880733</guid><dc:creator><![CDATA[cableguy245]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:26:13 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:35:15 GMT]]></title><description><![CDATA[<p>OK es hat funktioniert, du hattest mit deinem letzten Ansatz vollkommen Recht. Das Problem lag an einem der Input Files, dort waren statt Leerzeichen Kommas als Trennzeichen, aber wenn man ließt:</p>
<blockquote>
<p>For each event, in the order of the problem file, one per line:</p>
<p>The timeslot number, the room number.</p>
<p>The timeslot number is an integer between 0 and 44 representing the timeslots allocated to the event.</p>
</blockquote>
<p>Versteht man doch eher &quot;12,45&quot; als &quot;12 45&quot;... Naja DANKE nochmal für die Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880738</guid><dc:creator><![CDATA[cable245]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:35:15 GMT</pubDate></item><item><title><![CDATA[Reply to EXE aus (veraltetem?) C++ Code erstellen on Sat, 10 Apr 2010 19:37:25 GMT]]></title><description><![CDATA[<p>Kein Problem. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880739</guid><dc:creator><![CDATA[Magellan]]></dc:creator><pubDate>Sat, 10 Apr 2010 19:37:25 GMT</pubDate></item></channel></rss>