enum are not variables. They are constant value not constant variables ! A variable has a memory address;
a constant, no. What you try to do is the same that trying to get the address of 2.
User Profile
Collapse
Profile Sidebar
Collapse
jjdot
Last Activity: Mar 17 '11, 08:22 AM
Joined: Feb 28 '11
Location:
-
awk '{ if (n1 <= NR && NR <= n2) print NR $0; }' yourfile | grep expressionLeave a comment:
-
It is a good summary but to prevent portability problems
you should use either 3 or 4 forms.Leave a comment:
-
Because the parent process of your program calls it with
the 3 arguments by convention ! You can write for instance:
Code:struct t { double x; }; int main(struct t t) { return 0; }
a warning). Then if you execute your program:
myprog bla bla arg!
Who knows how to convert arguments...Leave a comment:
-
You can have a third argument that contains environment
variables; it is a NULL terminated array of strings.
int main (int argc, char **argv, char **env);
I had never seen any program using it. Perhaps because
you have to parse yourself strings in 'env'. Each string
has the form VARNAME=VALUE. The function 'getenv' is more
convenient to check the value (and even existence) of an
environment...Leave a comment:
-
Main is guessed to receive (at least) 2 arguments. Even if you can declare it with less arguments, the main function is called with the number of arguments and the array of arguments as parameters. Thus if 'main' is declared with
only 1 parameter this one receives (up to a cast) the number of arguments. In your second example, argv is assigned the number of arguments (+1 for the command name). So *argv[0] reads at address 1 which yields the...Leave a comment:
-
Perhaps that GNU libmicrohttpd will interest you:
http://www.gnu.org/software/libmicrohttpd/...Leave a comment:
-
remove the semi-colon at the end of first lineCode:while(fscanf(records,...
Leave a comment:
-
Ok. I'ignored existence of this type. In fact I always
use stdint.h. I found u_int32_t definition in header file
#include <sys/types.h>
I think the simplest way to do is to
#include <stdint.h>
#define u_int32_t uint32_tLeave a comment:
-
It is uint32_t and not u_int32_t. Normally you just have
to include:
#include <stdint.h>
on a 32 bits machine you can replace it by
#define uint32_t unsigned int
on a 64 bits machine I think you should work too but.Leave a comment:
-
I think you should enable all warning messages of your compiler. gcc -Wall used on your program gives:
t.c:16:1: warning: suggest parentheses around assignment used as truth value
t.c:17:1: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning
t.c:21:1: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning
t.c:16:4: warning: suggest explicit...Leave a comment:
No activity results to display
Show More
Leave a comment: