Search Results

Search found 5015 results on 201 pages for 'compiler construction'.

Page 26/201 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Is possible to generate constant value during compilation?

    - by AOI Karasu
    I would like my classes to be identified each type by an unique hash code. But I don't want these hashed to be generated every time a method, eg. int GetHashCode(), is invoked during runtime. I'd like to use already generated constants and I was hoping there is a way to make the compiler do some come computing and set these constants. Can it be done using templates? Could you give me some example, if it is possible.

    Read the article

  • problem understanding templates in c++

    - by hidayat
    Template code is not compiled until the template function is used. But where does it save the compiled code, is it saved in the object file from which used the template function in the first place? For example, main.cpp is calling a template function from the file test.h, the compiler generates an object file main.o, Is the template function inside the main.o file? because template code is not inlined, is it?

    Read the article

  • Easy way to convert c code to assembly?

    - by Bob
    Is there an easy way (like a free program) that can covert c/c++ code to x86 assembly? I know that any c compiler does something very similar and that I can just compile the c code and then disassemble the complied executable, but that's kind of an overkill, all I want is to convert a few lines of code. Does anyone know of some program that can do that?

    Read the article

  • 'Invalid conversion from some_type** to const some_type**'

    - by petersohn
    I've got a function that requires const some_type** as an argument (some_type is a struct, and the function needs a pointer to an array of this type). I declared a local variable of type some_type*, and initialized it. Then I call the function as f(&some_array), and the compiler (gcc) says: error: invalid conversion from ‘some_type**’ to ‘const some_type**’ What's the problem here? Why can't I convert a variable to const?

    Read the article

  • C++: Trouble with tr1::bind (C2065)

    - by Rosarch
    I'm getting a compiler error with bind: using namespace std; bool odp(int arg1, int arg2); // ... find_if(vec.begin(), vec.end(), tr1::bind(odp, iValue, _1)); // C2065 My goal is to curry odp(), so its first argument is iValue, and apply that function in find_if. The error: C2065: '_1' : undeclared identifier. What am I doing wrong?

    Read the article

  • C++ Performance/memory optimization guidelines

    - by ML
    Hi All, Does anyone have a resource for C++ memory optimization guidelines? Best practices, tuning, etc? As an example: Class xxx { public: xxx(); virtual ~xxx(); protected: private: }; Would there be ANY benefit on the compiler or memory allocation to get rid of protected and private since there there are no items that are protected and private in this class?

    Read the article

  • OpenSource programming-languages in development?

    - by pile of junk
    I'm very interested in interpreter and compiler development and because I don't want to continue building mini compilers and interpreters I thought I could help some open-source project. Are there currently open-source projects on compilers/interpreters in early stages seeking developers? I mean yeah.. There won't be much to do for someone like me in Python, Ruby, and so on.

    Read the article

  • Does (size_t)((char *)0) ever not evaluate to 0?

    - by Bruce Christensen
    According to the responses in "Why subtract null pointer in offsetof()?" (and my reading of K&R), the C standard doesn't require that (size_t)((char *)0) == 0. Still, I've never seen a situation where casting a null pointer to an integer type evaluates to anything else. If there is a compiler or scenario where (size_t)((char *)0) != 0, what is it?

    Read the article

  • C++ WCHAR: Cannot allocate an array of constant size 0

    - by Rosarch
    I'm trying to create a WCHAR: LONG bufferSize = foo.bar() + 1; WCHAR wszBaz[bufferSize]; The compiler issues an error: error C2057: expected constant expression error C2466: cannot allocate an array of constant size 0 error C2133: 'wszBaz' unknown size What am I doing wrong? UPDATE: I added const but it still gives the same error: const LONG bufferSize = foo.bar() + 1; WCHAR wszBaz[bufferSize];

    Read the article

  • Creating and Compiling a C++ project on Windows

    - by sc_ray
    I need to work on C++ project on my windows machine. My project will consist of various classes(.h and .cpp) as well as the startup file to start the application. The preliminary design is simple but the application has the potential to gain complexity as time goes by. What I need here is ideas to set up the C++ project compiler/IDE/Makefile etc..etc. as well as some standard tools besides Visual C++ to compile/build/link projects such as these on a Windows OS. Thanks

    Read the article

  • visual description for data structure

    - by radi
    i have a data structure for my compiler (such as ast) , and i need a method to print it (like ms visio) and verify its contents (i need to verify the contents of the ast nodes) note : i dont want to print it to the console , i am using c++ & qt thanks

    Read the article

  • Recompiling an old fortran 2/4\66 program that was compiled for os\2 need it to run in dos

    - by Mike Hansen
    I am helping an old scientist with some problems and have 1 program that he found and modified about 20 yrs. ago, and runs fine as a 32 bit os\2 executable but i need it to run under dos! I am not a programmer but a good hardware & software man, so I'am pretty stupid about this problem, but here go's I have downloaded 6 different compilers watcom77,silverfrost ftn95,gfortran,2 versions of g77 and f80. Watcom says it is to old of program,find older compiler,silverfrost opens it,debugs, etc. but is changing all the subroutines from "real" to "complex" and vice-vesa,and the g77's seem to install perfectly (library links and etc.) but wont even compile the test.f programs.My problem is 1; to recompile "as is" or "upgrade" the code? PROGRAM xconvlv INTEGER N,N2,M PARAMETER (N=2048,N2=2048,M=128) INTEGER i,isign REAL data(n),respns(m),resp(n),ans(n2),t3(n),DUMMY OPEN(UNIT=1, FILE='C:\QKBAS20\FDATA1.DAT') DO 1 i=1,N READ(1,*) T3(i), data(i), DUMMY continue CLOSE(UNIT-1) do 12 i=1,N respns(i)=data(i) resp(i)=respns(i) continue isign=-1 call convlv(data,N,resp,M,isign,ans) OPEN(UNIT=1,FILE='C:\QKBAS20\FDATA9.DAT') DO 14 i=1,N WRITE(1,*) T3(i), ans(i) continue END SUBROUTINE CONVLV(data,n,respns,m,isign,ans) INTEGER isign,m,n,NMAX REAL data(n),respns(n) COMPLEX ans(n) PARAMETER (NMAX=4096) * uses realft, twofft INTEGER i,no2 COMPLEX fft (NMAX) do 11 i=1, (m-1)/2 respns(n+1-i)=respns(m+1-i) continue do 12 i=(m+3)/2,n-(m-1)/2 respns(i)=0.0 continue call twofft (data,respns,fft,ans,n) no2=n/2 do 13 i=1,no2+1 if (isign.eq.1) then ans(i)=fft(i)*ans(i)/no2 else if (isign.eq.-1) then if (abs(ans(i)) .eq.0.0) pause ans(i)=fft(i)/ans(i)/no2 else pause 'no meaning for isign in convlv' endif continue ans(1)=cmplx(real (ans(1)),real (ans(no2+1))) call realft(ans,n,-1) return END SUBROUTINE realft(data,n,isign) INTEGER isign,n REAL data(n) * uses four1 INTEGER i,i1,i2,i3,i4,n2p3 REAL c1,c2,hli,hir,h2i,h2r,wis,wrs DOUBLE PRECISION theta,wi,wpi,wpr,wr,wtemp theta=3.141592653589793d0/dble(n/2) cl=0.5 if (isign.eq.1) then c2=-0.5 call four1(data,n/2,+1) else c2=0.5 theta=-theta endif (etc.,etc., etc.) SUBROUTINE twofft(data,data2,fft1,fft2,n) INTEGER n REAL data1(n,data2(n) COMPLEX fft1(n), fft2(n) * uses four1 INTEGER j,n2 COMPLEX h1,h2,c1,c2 c1=cmplx(0.5,0.0) c2=cmplx(0.0,-0.5) do 11 j=1,n fft1(j)=cmplx(data1(j),data2(j) continue call four1 (fft1,n,1) fft2(1)=cmplx(aimag(fft1(1)),0.0) fft1(1)=cmplx(real(fft1(1)),0.0) n2=n+2 do 12 j=2,n/2+1 h1=c1*(fft1(j)+conjg(fft1(n2-j))) h2=c2*(fft1(j)-conjg(fft1(n2-j))) fft1(j)=h1 fft1(n2-j)=conjg(h1) fft2(j)=h2 fft2(n2-j)=conjg(h2) continue return END SUBROUTINE four1(data,nn,isign) INTEGER isign,nn REAL data(2*nn) INTEGER i,istep,j,m,mmax,n REAL tempi,tempr DOUBLE PRECISION theta, wi,wpi,wpr,wr,wtemp n=2*nn j=1 do 11 i=1,n,2 if(j.gt.i)then tempr=data(j) tempi=data(j+1) (etc.,etc.,etc.,) continue mmax=istep goto 2 endif return END There are 4 subroutines with this that are about 3 pages of code and whould be much easier to e-mail to someone if their able to help me with this.My e-mail is [email protected] , or if someone could tell me where to get a "working" compiler that could recompile this? THANK-YOU, THANK-YOU,and THANK-YOU for any help with this! The errors Iam getting are; 1.In a call to CONVLV from another procedure,the first argument was of a type REAL(kind=1), it is now a COMPLEX(kind=1) 2.In a call to REALFT from another procedure, ... COMPLEX(kind=1) it is now a REAL(kind=1) 3.In a call to TWOFFT from...COMPLEX(kind-1) it is now a REAL(kind=1) 4.In a previous call to FOUR1, the first argument was of a type REAL(kind=1) it is now a COMPLEX(kind=1).

    Read the article

  • How to Increment Visual Studio build number using C++?

    - by Brock Woolf
    I have a Visual Studio 2008 project that produces a file called: "Game-Release.exe". This was configured under Project Properties - C/C++ - Linker - General: $(OutDir)\$(ProjectName)-Release.exe I would like to take this a bit further by have an incrementing build number so I would have something which says: Game-Release-Build-1002.exe The number on the end should be an incrementing integer. I will be storing the build exe's on subversion so I think i would find this useful (although not necessary). Perhaps there is a built in macro in Visual Studio that could handle this. Quite possibly I was thinking I could have a text file with the build number in it and have the compiler read, use and increment the number in the file each time the project is built. My goal is however to make the process as automated as possible. What is the best way to accomplish this? If you offer an opinion, please also provide the code we can all share. Thnx.

    Read the article

  • Method signature Vs function prototype

    - by Maroloccio
    A formal definition of the two? Current Wiki articles denote their different contexts and applications, such as internal type signature "strings" in Java VMs (1) and C/C++ function prototypes informing compilers of upcoming method definitions (2) but... 1) http://en.wikipedia.org/wiki/Type_signature 2) http://en.wikipedia.org/wiki/Function_prototype ... where to look for a definition which clearly and formally distinguished one from the other? There is literature using the words prototype and signature almost interchangeably yet other uses appear strict and consistent, if language-specific. Background: I am writing documentation for a sample compiler written for a University project.

    Read the article

  • Why not allow mutation of the this binding?

    - by gnucom
    Hi Everyone, I'm building a interpreter/compiler for a school project (well now its turning into a hobby project) and an instructor warned me not to allow mutation of the 'this' binding (he said it was gross and made a huge deal about it) but I never learned why this is so... dangerous or bad. I'm very curious about why this is so bad. I figured this sort of feature could be useful in some way or another. I'm wondering if anyone familiar with building languages can tell me what sort of problems mutation on the 'this' binding can cause, and if they know of any cool or useful tricks that one could do if it actually was allowed. Do any languages that you're aware of allow mutation of 'this'? Thanks,

    Read the article

  • BlackBerry - Error preverifying class java during build

    - by Davide Vosti
    I'm trying do build and debug a small project for BlackBerry. During the build I'm getting this error Error preverifying class java ... I read on the net this error could be caused by referencing multiple projects but I tried to move every package in a single project but the error is still there. I tried with multiple JDE version (currently 4.7) and the Java compiler is set to 1.6. Eclipse version is 3.4.1 as recommended by RIM's documentations. Does someone have some clue?

    Read the article

  • Visual Studio autoclean?

    - by kubal5003
    Hello, I have a solution with multiple projects - executable, library, and others(unimportant right now). Library contains EF entity classes and executable uses them. When I'm working on some code from the executable then every entity that I use is marked as an error and compiler says that I should check usings and references. Reference in the executable project is set to library project(not the dll itself). When I build the library project then everything gets back to normal, but when I start typing then it happens again. I could live with it, but intelli sense isn't working and that is quite a disadvantage. Any ideas?

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >