For example, when I call a method that returns an value, but I'm not interested in this at all, can I safely ignore that?
Example, instead of:
CGSize size = [str sizeWithFont:myFont minFontSize:19.0f actualFontSize:&actualFontSize forWidth:150.0f lineBreakMode:UILineBreakModeClip];
...do this:
[str sizeWithFont:myFont minFontSize:19...
What is the difference between these three?
...
Hi Folks,
First time poster here.
A quick question about setting up a loop here. I want to set up a for loop for the first 1/3 of the main loop that will increase a value from .00001 or similar to 1. So I can use it to multiply a sample variable so as to create a fade-in in this simple audio file playback routine.
So far it's turning...
In C: Why is so that only inline functions with internal linkage (ie declared with static) may reference (ie copy address, read, write, or call) a variable or function at file scope with static storage duration while other inline functions may not?
...
I have a pointer of a structure type that I made. On program start it begins as NULL and I then malloc/realloc as I need to add/remove these structures and I was just gonna use my pointer to point at the first structure and move through it like an array.
When I malloc/realloc I always make the size of the "array"/area in memory one larg...
As in this code:
int nx = (int)((rev3[gx]) / 193U);
Whats with the U in the end of 193 ?
...
It's not the largest integer type anymore now that there's "long long".
It's not a fixed-width type: It's 32 bits on some platforms and 64 on others.
It's not necessarily the same size as a pointer (for example, on 64-bit Windows)
So, does "long" have any meaning anymore? Is there ever a reason to declare a long instead of a ptrdiff_...
Hello,
I am playing around with multidimensional array of unequal second dimension size.
Lets assume that I need the following data structure:
[&ptr0]->[0][1][2][3][4][5][6][7][8][9]
[&ptr1]->[0][1][2]
[&ptr2]->[0][1][2][3][4]
int main()
{
int *a[3];
int *b;
int i;
a[0] = (int *)malloc(10 * sizeof(int));
a[1] = (int *)malloc(2...
Consider this program
int main()
{
float f = 11.22;
double d = 44.55;
int i,j;
i = f; //cast float to int
j = d; //cast double to int
printf("i = %d, j = %d, f = %d, d = %d", i,j,f,d);
//This prints the following:
// i = 11, j = 44, f = -536870912, d = 107...
Hi
I need ideas on how to write a C program that reserve a specified amount of MB RAM until a key [ex. the any key] is pressed on a Linux 2.6 32 bit system.
*
/.eat_ram.out 200
# If free -m is execute at this time, it should report 200 MB more in the used section, than before running the program.
[Any key is pressed]
# Now all the r...
I'm trying to increment the value of some specific key if it was found. For some reason I keep getting the (pointer) address when I dump all keys:values from the hash table.
Output
a: 153654132 // should be 5
b: 1
c: 153654276 // should be 3
d: 1
e: 1
f: 153654420 // should be 3
int proc()
{
...
Since LLVM/cLang is especially well designed.
This seems like a great opportunity to augment the C/C++ macro/preprocessor system.
Does anyone know of
additional macro/preprocessor abilities added by Clang or
side projects to make the macro system more powerful (like turing complete)
Thakns!
Note: I am asking about macros. Not C++ ...
I can't seem to find the right version of setup.h that gets used when building with ../configure, make. What directory is it? There seems to be tons of variations but I change them and the changes aren't used. Help.
...
Hi all,
is there any way where I can call c++ code from a c code
class a
{
someFunction();
};
how to call someFunction() from a c code.
in other way I am asking how to avoid name mangling here
regards
Vinayaka Karjigi
...
Right now I am going through MIT's introduction to Computer Science course via OpenCourseWare. As a part of this course I am learning the Python Language.
I've read a lot of things about the benefits of learning C. Before I dig any deeper into Python I wonder if I will be hindered or helped by learning Python first.
Do you think that I...
Hello everyone,
I am having trouble with a homework question that I've been working at for quite some time.
I don't know exactly why the question is asking and need some clarification on that and also a push in the right direction.
Here is the question:
(2) Solve this problem using one single subscripted array of counters. The pro...
Hello everyone!
This is just a simple question. I've been reading the source of something which attaches to a memory address of a subroutine using DetourAttach(&(PVOID &)BindKeyT, BindKeyD); where BindKeyT is the address to a subroutine in memory. I'm curious, what exactly does (&(PVOID &) mean in english? I understand that PVOID is a v...
Quick question, What have I done wrong here. The purpose of this code is to get the input into a string, the input being "12 34", with a space in between the "12" and "32" and to convert and print the two separate numbers from an integer variable known as number. Why doesn't the second call to the function copyTemp, not produce the value...
Hi,
I am currently porting our code from an alpha (Tru64) to an i386 processor (Linux) in C.
Everything has gone pretty smoothly up until I looked into porting our
exception handling routine. Currently we have a parent process which
spawns lots of sub processes, and when one of these sub-processes
fatal's (unfielded) I have routines to ...
recently, i am looking into assembly codes for #define, const and enum:
C codes(#define):
3 #define pi 3
4 int main(void)
5 {
6 int a,r=1;
7 a=2*pi*r;
8 return 0;
9 }
assembly codes(for line 6 and 7 in c codes) generated by GCC:
6 mov $0x1, -0x4(%ebp)
7 mov -0x4(%ebp), %edx
7 mov %edx, %ea...