It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
please tell me about #define
i want to execute c program when i wrote p in the place of printf
using #define but how please tell me...
#define p printf
int main() {
p("hello world");
return 0;
}
#define P(X) printf("%d\n",X)
This only works for int tho. careful.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How to Optimize this piece of C code...??
int c = no, diff = u - d;
while (no--)
for (d = u; d < p[no]; d += diff)
c++;
The best optimization, for size, speed, cleverness, clarity, and anything else you may think of, is to have no code.
So, just remove those 4 lines from your source(s) and you've optimized your code.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am planning to develop an application (could be in C or Ada!!) to exchange the data between two computers.
Please help me out to start this work.
Here's a start if you happen to chose C:
int main(int argc, char *argv[])
{
...
return 0;
}
Just fill in the "..." part, add new functions etc. as appropriate.
Or maybe ask a more specific question. ;-/
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
IN C what will be the actual execution when the for loop syntax is for (initializer;incrementation;condition)
eg:
for(i=1;i<100;i++)
{
printf("%d",i);
}
It will be
123456789...99
Unless your libc doesn't flush stdout on close. Or are you asking how it works, in which, case, It's equavalent to:
initializer;
while(condition){
...
incrementation
}
or
i=1;
while(i<100){
printf("%d", i);
i++;
}
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I want to use abc1 ,abc2, abc3,abc4,..abc100,as struct variable name. But I don't know how to set this? have no idea.
Can anybody help me out?
Thanks indeed.
It sounds like you're looking for an array.
typedef struct {
/* ... */
} whatever;
whatever abc[100];
abc[0] = xxx;
abc[3] = yyy;
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 13 years ago.
I need some really ugly C macro (as an example, not to any real project), that does some simple thing (like adding one, for example) really hard and unreadable way.
Anyone has some idea?
#define new delete
#define True 0
#define False -1
#define BEGIN {