Aber gerne:
#include <iostream>
#include <conio.h>
using namespace std;
int a = 1;
int b = 2;
int main()
{
cout << a << " " << b << endl;
//swap (a,b)
__asm("mov _b, %eax");
__asm("mov _a, %ebx");
__asm("mov %eax, _a");
__asm("mov %ebx, _b");
cout << a << " " << b << endl;
getch();
return 0;
}
Wichtig: Der Dev-C++ nutzt die AT&T-Syntax im Gegensatz zur Intel-Syntax.
Beispiel: The order of the source and destination operands are switched. AT&T syntax uses 'Source, Dest', while Intel syntax features 'Dest, Source'. Thus the Intel construct 'add eax, 4' transforms to 'addl $4, %eax' in the AT&T dialect.
siehe http://www.tu-harburg.de/rzt/rzt/ts/kurs/pascal/doc/prog/node12.htm
daaaaanke vielmals...
endlich! nach einer neuinstallation funktioniert nun alles
wieder...der fehler war, dass ich neue version über die alte
installiert habe *kopfschüttel*
freundlichst teufelchen
@Erhard Henkes
bist aber früh aufgestand || spät ins bett
#include <conio.h>
int main()
{
getch();
}
Der einfachste Weg unter MS Windows, um das Schließen der DOS-Box zu verhindern.
Direkt in der DOS-Box oder Linux-Konsole kann das entfallen.
Erhard Henkes schrieb:
...
http://prdownloads.sourceforge.net/dev-cpp/devcpp4980.exe
Installationsdatei: devcpp4980.exe (12.627.146 Bytes)
Und dann mit vUpdate gleich auf die aktuelle Version (bei meinem letzten Test: 4.9.8.1) updaten.....
Jo, thx, das printf(...) hatte ich ursprünglich wegen __int64 (MSVC++) eingebaut, weil cout dort seinen Dienst verweigerte. Also die nächste Version:
// Berechnung der "3n+1"-Folge (Collatz-Folge)
#include <iostream>
using namespace std;
int main()
{
/*********************************************************** Eingabebereich ****************************/
const unsigned long long element_limit = 1000000 ; // Maximum H(n)
const unsigned long long element_print_limit = 1000 ; // Ausgabe nur, wenn H(n) > element_print_limit
const unsigned long long start = 1000000000000000000 ; // Beginn der Berechnung bei start
const unsigned long long end = 2000000000000000000 ; // Ende der Berechnung bei end
/*********************************************************** Eingabebereich ****************************/
for( unsigned long long j = start; j < end; j++ )
{
unsigned long long zahl = j ;
unsigned long long i = 1 ;
while( ( zahl != 1 ) && ( i <= element_limit ) )
{
if( zahl % 2 == 0 )
zahl /= 2 ;
else
zahl = 3 * zahl + 1 ;
i++ ;
}
if( zahl == 1 )
{
if( i > element_print_limit )
{
cout << "Startzahl: " << j;
cout << "\tAnzahl: " << i << endl;
}
}
else
{
cout << "Startzahl: " << j;
cout << "kein Resultat (Anzahl-Limit erhoehen)" << endl;
}
if( i > element_limit ) cerr << "Anzahl zu hoch" << endl;
}
}
Anmerkung: MSVC++ 6 akzeptiert standardmäßig kein "long long", dort __int64 mit printf(...)
Hallo,
ich habe vor 1 Monat angefangen mit Power++ WIN-Programme zu erstellen. Ich habe ein Problem mit den Click-Buttons. Auf dem Rechner wo ich entwickle sind die Sichtbar, erzeuge ich aber eine lauffähige EXE-Datei und starte die an einem anderen PC, zeigt mir die Anwendung nur Punkte anstelle der Buttons.
Die kann man auch ancklicken, sind halt nur Punkte. Mache ich da etwas Falsch?
Alles andere ist sichtbar. Ich arbeite mit WIN2000.
Vielen Dank im Voraus!
Matthias-Claudio schrieb:
Kannst du mir vieleicht ein Beispiel nennen ?
versuch dich dochmal an dem c++ faq.. lege eine datei in den ordner, in dem du arbeitest, öffne sie, speicher sie und schreibe sie unter einen anderen namen wieder zurück auf die platte.
da steht sogar ein beispiel drin... scheinst es nicht angeschaut zu haben
von hume:
using namespace std;
// Quelldatei
ifstream FileInCopy("d:\\cdtemp\\uncle_kracker-follow_me.mp3", ios::binary);
// Zieldatei
ofstream FileOutCopy("d:\\cdtemp\\uncle_kracker-follow_me.mp3.bak", ios::binary);
if (FileInCopy)
FileOutCopy << FileInCopy.rdbuf();
Wenn ich die aktuelle FLTK2cvs unter cygwin compilieren will, bekomme ich immer diesen Compilerfehler: http://www.planetcoding-server.net/misc/fltk-compile-error.png
Hat jemand eine Idee, woran das liegen könnte?
hi
eine sache habe ich dazu gefunden, weils mich interessiert hat, kann ja sein, daß es weiterhilft...:
frage hier:
[sigc] undefined reference to `Sim::SigC::ObjectScoped virtual table'
http://www.geocrawler.com/archives/3/3727/2001/1/0/5017329/
antwort dort:
http://www.geocrawler.com/archives/3/3727/2001/1/0/5019273/
This sounds a bit like a problem with where the vtable got
put. On some versions of gcc I have noticed that if you do
not declare and define the dtor of a class which uses sigc++
it returns such an error.
Try adding a dtor to your class (both the signal user and
the signal receiver) and see if that clears things up.
The dtor should not be inline. It must appear in a .cc
file so that the compiler knows which object file to
place the vtable.
Hope it helps.
--Karl