first of all, 'v' may not be a pointer.
Type: Posts; User: valenok
first of all, 'v' may not be a pointer.
you have to understand how the function call works,
the stack memory layout before and after the call.
If you do not get it, there is no chance you'll understand va_start() macro.
some assembler...
the _INTSIZEOF(n) macro, I beleive, calculates the size of last named
argument, 'rounded' to sizeof(int), because v, push-ed on stack before
call to foo(), is 'rounded' to size. For example, on...
to make the picture more clear:
stack memory inside foo():
200
100 <-- va_start() sets 'ap' here
3 <-- this is &v. we need to increase to size of v to shift to the first unnamed arg
2
1...
v is the the argument before ...
va_start actually sets the pointer 'ap' to point at the stack memory exactly
below 'v':
void foo(int a, int b, int c, ...);
...
foo(1,2,3,100,200)
stack:
lpszThisIsMyFormatString. i like that.
vice, you need to read a book.
"The C programming Language" by Kernighan & Ritchie,
chapter 7.3, "Variable-length Argument Lists"
does that apply for main() function or for any function ?
please, tell me the section where they are described
by the way, FAQ mentions that in C99 return 0 is implied if no return is
present and main() declared as int main().
in what section is it, by the way ?
are there rules in C99 about implicit return...
on unix, bidirectional streams could be created with
socketpair() and fdopen().
standard pipes are one-way.
you cannot read and write to the pipe at the same time.
If you have opened the pipe as "r", you cannot write to it.
actually, that tutorial is not fully correct. For example, this
struct node {
int x;
node *next;
};
use 'int' for boolean type.
what kind of boolean functions are you talking about?
I can see two ways:
1. declare utf-8 string as a byte array:
unsigned char utf8[] = { 'a', 'b', 0 };
2. declare string as wide char string, then convert to multibyte.
in some situations, you can scan using sscanf().
The format string must be carefully prepared though.
For example, this one may work for you:
const char *str = "Value = California(100)";...
Yeah. Basically, what you do, is assigning to every variable a unique
index number.
Then you represent a user filter as an array of indexes.
Then, for each row, you prepare a values array....
I would solve this problem this way:
User filter I would represent as an array of variables to see:
enum {VAR_NONE, VAR_A, VAR_B, VAR_C};
So, the "B B" filter would look like:
int filter[] =...
by reading standards, and by actually building programs on different platforms.
you may go to http://www.freebsd.org/cgi/man.cgi
there are man pages for many OSes. in your case, check every...
I suggest not using linuxisms. MSG_NOSIGNAL is one of them.
The more portable code is, the better.
note that laserve himself invented array of pointers to long.
it was array of long-s.
For every function call stack frame is allocated.
Shortly, the stack frame consists of return address, stack pointer and local variables.
If local variables take a lot of space (for example, huge...
do not recurse that much
there are macros in <ctype.h>, like isdigit() etc.
Yeah, the algorithm may be as this:
1. extract substring.
2. traverse the storage, looking for duplicate (storage explained below)
2. 'remember' substring in some storage (put it in the array,...
Laserve, how comes that memset leads() to an undefined behaviour?
Make it clear please.