Join 136,538 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,784 people online right now. Registration is fast and FREE... Join Now!
# include <C:\j2sdk1.4.2_03\include\jni.h> # include <C:\Program Files\InstallShield\InstallShield for Microsoft Visual C++ 6\Include\project.h> # include <stdio.h> # include <string.h>
Is JNI necessary for this? I looked at your requirements in the Java section, but I don't see why you couldn't still implement it like a traditional compiler. By this I mean that the compiler would be a standalone executable, and the Java would simply be a front end to it.
my guide asked me to get a Java interface for the compiler, to make it user friendly. He say there are things in the C actual compiler part which cannot be implemented from Java proper. Hence the result is the combination of both the language one for this and the other for that.
Note: Why are you doing this in JNI? -- this far easier to do in java proper!
sorry, nick your code got the same problem as of me. Instead of returning capital it is returning garbage value.
i am using the string between ^c<char array>c^ because ^c and c^ is my command which is to be passed to make the required string capital.
this project is similar to the Latex software if anyone can help in that case.
QUOTE(perfectly.insane @ 15 Aug, 2008 - 02:48 PM)
Is JNI necessary for this? I looked at your requirements in the Java section, but I don't see why you couldn't still implement it like a traditional compiler. By this I mean that the compiler would be a standalone executable, and the Java would simply be a front end to it.
The variable t hasn't been initialized, so you can't do that. It would have to be:
char* t; t = str;
Not: *t = *str, which assigns the first character of str to the first character of t, and since t isn't initialized, it won't work (it will likely cause a crash).
This post has been edited by perfectly.insane: 16 Aug, 2008 - 08:14 AM
A compile error, a runtime error, or it simply doesn't function as needed?
during compile time only warnings are given:
and the when i click the compile button garbage values are printed for infinite times.
QUOTE(perfectly.insane @ 16 Aug, 2008 - 09:13 AM)
The variable t hasn't been initialized, so you can't do that. It would have to be:
char* t; t = str;
Not: *t = *str, which assigns the first character of str to the first character of t, and since t isn't initialized, it won't work (it will likely cause a crash).