Possible Duplicate:
Alternatives to Java for Android development?
I want to make apps for Android (Mobile OS) what other language(s) can i make them in EXCEPT java?
Thank you in advance ;-)
...
Hi all,
I have written a C library which consists in a few .h files and .c files. I compile it as a .a static library.
I would like to expose only certain functions to the user and keep the rest as "obscure" as possible to make reverse engineering reasonably difficult.
Ideally my library would consist of:
1- one .h file with only th...
Hello.
I'm very new to C and I decided to make a function called str_replace which replaces strings inside strings which have been made using malloc. It appears to work but can anyone find any room for improvements.
Any advice will be appreciated. I'd like to know if people think finding the number of occurrences to calculate the new s...
I would like to have a function written in C, but callable from C++ which takes a restricted pointer. This is only available in c99, so g++ doesn't like it, even in extern "C" blocks. How can I get around this limitation?
...
I'm writing some C and I have a lookup table of ints. I'm a little rusty... where do I declare and initialize the array so that I can use it in multiple C files? Can I declare it in an H file and initialize it in a C file?
...
I have this float which is a rotation angle.
Camera.roty += (float) diffx * 0.2;
where diff is the change in mouse position.
In OpenGL it will wrap it if it exceeds 360 or is below 0, but how could I do this if I want to verify if the angle is between 0 and 180?
Thanks
...
Hi, (this was asked on ffmpeg-devel list, but counted way offtopic, so posting it here).
ffmpeg.c loads multiple .c's, that are using log.c's av_log -> av_log_default_callback function, that uses fputs;
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
{
...
snprintf(line, sizeof(line), "[%s @ %p] ", (*par...
main file (prog.c):
#include "log.c"
#include "library.c"
static char * Foo;
If some variable (char * Foo) is defined in main file (prog.c), and it is required by log.c function called from library.c, how to correctly declare Foo to be visible from log.c's namespace?
...
I need to parse a file that could be many gbs in size. I would like to do this in C. Can anyone suggest any methods to accomplish this?
The file that I need to open and parse is a hard drive dump that I get from my mac's hard drive. However, I plan on running my program inside of 64-bit Ubuntu 10.04. Also given the large file size, the ...
I'm working on a tasklist program to brush up on my C before I take a class. I have two structs, task and tasklist.
Here is the task struct:
typedef struct task
{
char name[100];
bool completed; /* bool is described as an enum in an included header file */
date due_date; /* date is a described as a struct in an included header f...
Performance tuning: writing data to multiple pipes
Now I'm doing it in a single thread:
for(unsigned int i = 0; i < myvector.size();)
{
tmp_pipe = myvector[i];
fSuccess = WriteFile( tmp_pipe, &Time, sizeof(double), &dwWritten, NULL );
if(!fSuccess)
{
myvector.erase(myvector.begin()+i);
printf("Client pip...
hPipe = CreateNamedPipe(
lpszPipename, // pipe name
PIPE_ACCESS_DUPLEX, // read/write access
PIPE_TYPE_MESSAGE | // message type pipe
PIPE_READMODE_MESSAGE | // message-read mode
PIPE_WAIT, // blocking mode
PIPE_UNLIMITED_INSTANCES, // max. instances
10...
I'm making a game that is entirely made of cubes. I notice that when I walk forward it runs lightening fast, but if I rotate the player in the opposite direction, its cripplingly slow. So what I did is ordered based on angle, but I still get some angles that are a bit slow. Here is how I did it:
I basically reverse iterate in certain an...
My game renders lots of cubes which randomly have 1 of 12 textures. I already Z order the geometry so therefore I cant just render all the cubes with texture1 then 2 then 3 etc... because that would defeat z ordering. I already keep track of the previous texture and in they are == then I do not call glbindtexture, but its still way too m...
Why does the following compile in C++?
int phew = 53;
++++++++++phew ;
The same code fails in C, why?
...
Do lfind/lsearch perform better than a typical looping solution that checks each item until it matches? Is there any special sauce/reason that these functions exist?
...
Hi all,
I have created three UIImageViews. I then added a UITextField to each image as a subview.
When the user clicks on the text field I want to capture which UIImageView ths text field belongs to. I am trying the following code :
-(void)textFieldDidBeginEditing : (UITextField *)textField {
textField = retainedObject;
MyPicture *...
Does C allow to place a string terminator at the end of read bytes full of garbage or is it only guaranteed if the read bytes are chars ?
I need to read something like this from stdin but I do not know how many chars to read and EOF is not guaranteed:
Hello World!---full of garbage until 100th byte---
char *var = malloc(100 + 1);
...
char* fstrstr(char *s1,char *s2)
{
int i=0,flag=0;
char *s4,*s3;
// s4 for retaining the value of s2
s4 = s2;
while(*s1 != '\0' && *s2 != '\0')
{
if(*s1 == *s2)
{
*(s3+i) = *s1;
s2++;
s1++;
i++;
flag = 1;
}
else
{
...
There are a lot of games that can generally be viewed as a bunch of objects spread out through space, and a very common operation is to pick all objects in a sub-area. The typical example would be a game with tons of units across a large map, and an explosion that affects units in a certain radius. This requires picking every unit in the...