For example:
void DeleteLastNode(NodeType **L)
If **L represents the address of the variable L, can it not be replaced by &L instead? Also, if I were to use *L or simply just L, would I not be able to change L's contents? If so, what's the difference of using *L and L, if L is a pointer to it anyways? Would I not be able to look at it...
I am trying to cross-compile busybox but I am getting 'undefined reference' at the linking stage. Using nm, the symbol were in fact missing from the library file (libbb.a in my case.) Looking into the source ('busybox/libbb/xfuncs.c'), there are all these #ifdef L_<function_name> wrapping around the functions in question. Does anyone ...
Hi,
Program below runs fine on windows. But compilation error occurs on linux
"error: pasting "." and "config" does not give a valid preprocessing token"
Any reason??? i cant understand why....
#include <stdio.h>
typedef struct pr {
int config;
}pr_t;
#define JOIN(x,y) x.##y
void main()
{
pr_t temp = {5};
printf("Value %d\n...
I didn't know that C and C++ allow multicharacter literal: not 'c' (of type int in C and char in C++), but 'tralivali' (of type int!)
enum
{
ActionLeft = 'left',
ActionRight = 'right',
ActionForward = 'forward',
ActionBackward = 'backward'
};
Standard says:
C99 6.4.4.4p10: "The value of an
integer character const...
I currently have something close to the following implementation of a FPS independent game loop for physics based games. It works very well on just about every computer I have tested it on, keeping the game speed consistent when frame rate drops. However I am going to be porting to embedded devices which will likely struggle harder wit...
Hi All,
I am trying to build my PRO* C application in 32 bit mode using Oracle 10g 64 bit on Solaris SPARC platform.
Can someone tell me what settings has to be made inorder to successfully compiler and create an executable?
Currently when i switch my LD_LIBRARY_PATH=$ORACLE_HOME/lib32, proc fails with the following error
ld.so.1: pr...
I saw this question been asked at SO few hours ago.
My question is related to it but just a bit different and is a result of Johannes Schaub-litb's comment to Oli Charlesworth's answer.
Is i = (0, ++i, 0) undefined behavior?
P.S:
This is just for educational purpose and has no relation with real life code or examples. Please ignore th...
Possible Duplicate:
How, exactly, does the double-stringize trick work?
I came across this the other day - can someone tell me how it works?
A simple way to stringize a C
preprocessor constant, in all
compilers conforming to ANSI C (or any
C++ compiler).
Suppose you have a header file
containing a constant li...
I have a function definition, where i call multiple functions. Even if one of the function fails i need to go ahead and call the rest of the functions and finally return a single error saying whether any of the function call failed. The approach which i had followed was
int function foo()
{
int res, res1, res2, res3;
res1 =...
Hi,
I'm writing a C program using gcc in cygwin. My question is, how do you create a makefile? I mean, what file-extension does it have? I know how to write simple rules, but I can't save a file in the text-editor with the right extension?
Impossible to find any info about this...
This is prolly a super-newbie question. So let the flami...
Hello! Back with my daily silly question. Today I'm trying to put a struct in an NSArray. Alright, that's easy, wrap it in a NSData. If you know me, you know you're about to see code. In this example, I'm loading a vertex line from a Wavefront OBJ into a struct and sticking it in an array.
NSArray *verticeLineParts = [currentLin...
Hi All,
So, I have a task to find number of substrings in given string. I can't use any C libraries for doing this task. stringExist can only have 2 strings as a parameters.
My solution is working, but I have a feeling that there should be a more elegant way to do this task.
Solution 1: as it turns out, it doesn't work correctly
#incl...
void main()
{
float f = 0.98;
if(f <= 0.98)
printf("hi");
else
printf("hello");
getch();
}
I am getting this problem here.On using different floating point values of f i am getting different results.
Why this is happening?
...
Possible Duplicates:
Why doesn't Java have compound assignment versions of the conditional-and and conditional-or operators? (&&=, ||=)
Why does a &&= Operator not exist?
Today at work I wrote the following LOC (the real identities of b and b1 are confidential :)
b &&= b1; // meaning b = b && b1;
I stared at it for a co...
- (void) Scrollviews
{
self.scrollView = [[[UIScrollView alloc] initWithFrame:CGRectMake(32, 110, 3000.0, 237.0)] autorelease];
self.scrollView.contentSize = CGSizeMake(NPAGES * 320.0f, scrollView.frame.size.height);
self.scrollView.pagingEnabled = YES;
self.scrollView.delegate = self;
[self.scrollView setUserInteract...
Hey, I was looking for a good MP3 or OGG decoder that use the BSD license or public domain and that is also light-weight (something that comes with sources without the need of platform specific configuration).
...
Hi - In GetPrivateProfileString, lpReturnedString returns the string value present in the key of a particular section of an ini file.
My question is that how will i know exactly, how much memory has to be allocated, rather than just allocation a large chunk prior to calling this function.
DWORD WINAPI GetPrivateProfileString(
__in ...
As above, how do I get the AppData folder in Windows using C?
I know that for C# you use Environment.SpecialFolder.ApplicationData
...
I came across some code written in C that looks like this:
if (file == NULL)
TRUE; /* <-- What does that mean? */
I think that it is another way of saying:
if (file == NULL);
But am I missing something, and is there a reason to do it the first way as opposed to the second way?
UPDATE:
Doing some digging, TRUE is defined as s...
I need to write a simple program that ask the user to insert 4 double type variable in a struct variable data.
struct Data
{
double a;
double b;
double c;
double average;
};
struct Data *ptr_name;
int i;
First, ask user the size:
printf("Please enter the size:");
scanf("%d", &size);
Then, use ...