where the local, global, static, auto, register, extern, const, volatile variables are stored ?
where the local, global, static, auto, register, extern, const, volatile variables are stored ? ...
where the local, global, static, auto, register, extern, const, volatile variables are stored ? ...
Hi all, I have a three UIImageView variables called myPicture1, myPicture2 and myPicture3. In a for loop I am trying to increase the number at the end of myPicture by 1 so that I can assign a random image to each of the three variables. Here is the code below : for (i=0; i<3; i++) { int g = arc4random() % 19; NSString *imagename = [...
In solaris when I attached dbx to one of the running stacks, I found the call to fwrite leading to __lll_lock_wait()? In what scenario will this happen? Does fwrite internally tries to acquire a lock? ...
What will happen if fwrite & fclose are called in parallel from two threads for the same file descriptor? ...
I have been looking at this game called Minecraft and was intrigued by how it can dynamically generate random maps that look and feel right. What types of algorithms are used to generate terrains based on cubes like this? Thanks ...
Hello, gcc 4.4.4 c89 Not sure why I am getting this error. In my header file I have the following handle.h typedef struct Handle_t Handle In my implementation file handle.c struct Handle { size_t id; char *name; }; Handle* create_handle(size_t id) { Handle *hdev = NULL; hdev = malloc(sizeof(*hdev)); /* Error */ ...
Would anyone be kind enough to explain what infix, postfix and prefix notation is in regards to the C programming language? Thanks, ~Daniel ...
I have a string, "-(1-cos(R*T))/R", that I need to be evaluated in both C and C#. Is there a library, or a quick way to do this? Or do I need to write my own parser? I'm also assuming that R and T are known and are local variables. ...
My code is hanging fwrite with the following stack: libc.so.6.1::___lll_lock_wait libc.so.6.1::fwrite This seems to be happening in solaris. Only incorrect thing which I can think of is that my code may try to do a parallel fclose on the same FILE pointer which is used for doing fwrite. If a parallel fclose happens will it lead to th...
Here are the arguments that I am using: -Xmx1024m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=11999 The -Xmx1024m work fine without passing the -agentlib, and the -agentlib works fine without Xmx. Can you set the max heap size while using the agentlib? My jar file is getting launched via C code: execlp(myJavaPa...
I'm working with C, but I think this is a more low level question that isn't language specific. How does the program correctly grab the right data with array[0] or array[6] regardless of what type of data it holds? Does it store the length internally or have some sort of delimiter to look for? ...
I want to control multiple robots using my laptop. Robots do not have intelligence, they are sending sensor values to PC which computes the sensors values and sends back result to robots.(Centralized control of robots using PC ). Robots are communicating with PC through serial communication using Zigbee mudule. Problem: How to make & ...
I'm wondering if it's possible to draw over an opengl/direct3D surface with GDI? and if so, how might it be done? The reason I ask is because I'm writing a simple app to draw a few things in games. Such things would all be 2D or text such as framerate info, custom crosshair, clock, etc. I know the best way is to hook in and use whateve...
Say that I have a C program and it has this line: int a = 12; Is the value of 12 bound to 'a' during compile time? Or is the value placed into memory during run time when the scope of the program hits 'a'? What about programming languages like Python and Ruby? Are there languages/instances where a value is statically bound to a vari...
I need to print out a 3 by 3 matrix in C. I could think up of 3 different ways of doing it. Are all of them equally optimal or is one method better than the other? Function 1: Passing an 2darray, using array subscripts void printMatrix(int m[][3]) { int i,j; for(i=0;i<3;i++) { for(j=0;j<3;j++) { printf("%d\t",m[i][j]); } ...
A simple C program which uses gettimeofday() works fine when compiled without any flags ( gcc-4.5.1) but doesn't give output when compiled with the flag -mno-sse. #include <stdio.h> #include <stdlib.h> int main() { struct timeval s,e; float time; int i; gettimeofday(&s, NULL); for( i=0; i< 10000; i++); gettimeof...
Hiya, my code currently has three functions each producing a massive array of random numbers. Im wondering if there is a way of just having one function returning a linked list or multidimensional array to make it a bit neater: (copied from http://pastebin.com/Y5aE6XKS) #include <stdio.h> #include <stdlib.h> #include <math.h> #include...
I am in the process of trying to build putty tray, a variant of putty, from source on a Windows 7 system. I need to build it, not just download it, because I need to implement some additional functionality. I'm using nmake and (shouldn't be relevant) the Microsoft C++ compiler. To be precise, I'm working in a cmd window, I'm in the WINDO...
I want to make iphone apps but do i really need to learn objective c ? I love Languages like Ruby, Python and PHP. Is it really worth me spending my time learning objective c ( i understand i have to learn c first)? Any advice, help, tips tricks would be greatly appreciated. Thank you in advance ;-) ...
Possible Duplicate: An algorithm to decompose a whole number into all possible sets of whole numbers that sum to it. An algorithm which for any input positive integer, gives all possible distinct arrays of positive non-zero integers that can sum to it. e.g Inputting 4 returns (1,1,1,1), (1,1,2), (1,2,1), (2,1,1), (1,3), (3,1)...