English
C ++ Forum

Zeiger

 
- Page 1 -


Hello, somehow pack I it with the Zeiger not of C++(Dev C++).
it comes here the worth 0 out, really wished I 45 having.

who knows itself there from with the Error, whom I with the Zeiger made have?

mfg
peter
CompileMarkSeparation
declare testram#
dim testram#,100
cls
test()
print byte(testram#,0)
WaitInput
end

proc test

    parameters testram#
    int *a;
    *a=addr(testram#);
    a[0]=45;

09/13/08  
 



 
- Page 2 -


and another For-Loop in C++.
Hui, The goes ex, 10x 10.000.000.

can I hardly believe, confirm the please times.
I have 180ms.
Sebastian kannste The time testing, not the The Variable with 10.000.000 wrong go through becomes.

mfg
peter
CompileMarkSeparation
 
09/13/08  
 



long *pL = (long*)PVAR(ram#);

The commands is not .

mfg
peter
 
09/13/08  
 



sure the You do not long pL = (long*)PVAR(ram#) mean? Have no prf2cpp to hand...
 
09/13/08  
 



Have no prf2cpp to hand...

becomes but Time, the it with you standard becomes these Wunderwaffe ala C++ with Profan2ccp.

mfg
peter
 
09/13/08  
 



long pL = (long*)PVAR(ram#)

Compilerfehler..

Nimm these Variante : char* pL = reinterpret_cast<char*>( adrr);

mfg
peter
 
09/13/08  
 




Sebastian
König
Peter Bierbachh
long pL = (long*)PVAR(ram#)

Compilerfehler..

Nimm these Variante : char* pL = reinterpret_cast<char*>( adrr);


OK, the reinterpret_cast<>() is in the doing The secure Variante, since the Memory-Variables in the of Profan2Cpp begot code first of all time no Zeigertyp (but in Grunde simply long) are. some Compiler meckern then whom middle-aged C-Style Cast with (long*) on.

your code looks really from . naturally runs the then very quick. for such things is Inline-C++ though not at all necessary, the the XProfan-code indeed to C++ Translated becomes. You can to that example time this here testing:
CompileMarkSeparation
declare test%,i%
cls
test%=&GetTickCount

whileloop 1,10,1

    schleife_prf()
    print i%

endwhile

proc schleife_prf

    var zahl% = 0

    whileloop 10000000

        zahl% = zahl% + 1

    endwhile

endproc

Print Str$(Int(&GetTickCount-test%))
WaitInput
end

If I The Compiler-Optimierungen (with the TuneMake-Plug-In  [...]  ) deaktiviere, can I none Geschwindigkeitsunterschied To your Variante with the Inline-code More check.

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/14/08  
 



OK, the reinterpret_cast<>() is in the doing The secure Variante,

can you for once more a substitute reinstellen, whom then any Compiler receive?

mfg
peter
 
09/14/08  
 



here see it differently from.
installed in the program as C++ and then with Profan2cpp : 143ms Dev C++ and 135ms with BCC55
as normales Program with Profan2cpp prepares : 670ms with DEV c++ and 390ms with BCC55

mfg
peter
CompileMarkSeparation
cls
declare bildxy#,laenge%,test%,z%
dim bildxy#,65000
laenge%=65000
test%=&GetTickCount

whileloop 1,100,1

    z%=rgb_farbe_cpp(bildxy#,laenge%)

endwhile

Print Str$(Int(&GetTickCount-test%))
WaitInput
end

proc rgb_farbe_cpp

    parameters bildxy#,laenge%
    declare r%,g%,b%

    whileloop 0,laenge%-1,4

        b%=byte(bildxy#,&loop)
        g%=byte(bildxy#,&loop+1)
        r%=byte(bildxy#,&loop+2)

        if (b%>252) | (g%>252) | (r%>252)

            z%=255
            break

        endif

    endwhile

ENDPROC

 
09/14/08  
 




Sebastian
König
Peter Bierbachh
OK, the reinterpret_cast<>() is in the doing The secure Variante,

can you for once more a substitute reinstellen, whom then any Compiler receive?


The reinterpret_cast<>() ought to really of all Compilern recognized go - he's part the standard-C++ Sprachumfangs.... What exactly functions because not? generally counts, that one itself with Inline-C++ integrally simply on the hold must, what the used Compiler supported. I can only at Übersetzen the XProfan-Codes ensuring, that the Result with all supported Compilern runs.

Peter Bierbach
here see it differently from.
installed in the program as C++ and then with Profan2cpp : 143ms Dev C++ and 135ms with BCC55
as normales Program with Profan2cpp prepares : 670ms with DEV c++ and 390ms with BCC55


OK, then comes it well on whom individual case on. Inline-C++ is naturally useful for very geschwindigkeitskritische items - like Inline-ASM in C++. latter went incidentally too inside the INLINE_CPP-Blocks, but I work to Time too at a direct Support of Franks XPIA in Profan2Cpp .

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/14/08  
 



 
- Page 3 -


functions now everything lovely...

mfg
peter
 
09/14/08  
 




Sebastian
König
Peter Bierbachh
functions now everything lovely...


super, the freut me naturally!
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/14/08  
 



both Compiler Dev C++ To 4.9.8 and the BCC55 have I in Test had.
now has the BCC55 always The nose in front had. with the Bereichsvariablenüberprüfung/comparison up to 3x faster. one should itself on the Schleifentest(Whileloop etc) not leave. there was namely always the DEv C++ faster, if it but in that potted went was the BCC55 the faster.

have any my censorial Grafikprogramme with Opengl etc, The here in the Forum to Discussion were/are , fehlerfrei übersetzten can.
an amazing performance too whom direct C++-code einzusetzen was/is a riesengrosser success (after I it understood having).

Profan2cpp is invincible. especially since it The among other things good einfachen C++-Compiler (Dev C++ and BCC55) fehlerfrei bring into action can.
If still The ASM-routines with XPIA/XPSE there reinkommen,...

for my ASM-routines have I me bridge built.
I use The erstellte DLL of XPIA/XPSE with the Def-appeal, no wesentlicher hoisted these reinzusetzen.

mfg
peter
 
09/14/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.655 Views

Untitledvor 0 min.
funkheld12/17/13
H.Hackl03/22/12

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie