fr.comp.lang.c
  Home FAQ Contact Sign in
fr.comp.lang.c only
 
Advanced search
December 2006
motuwethfrsasuw
    123 48
45678910 49
11121314151617 50
18192021222324 51
25262728293031 52
2006
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
fr.comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: opérateur         


Author: Jean Pierre Daviau
Date: Dec 31, 2006 05:29

> Oui mais ce n'est pas la même chose (ça n'a pas la même
> sémantique
> quoi).
> a == b
> compare les pointeurs et c'est souvent très utile parce qu'il
> n'est pas
> nécessaire de comparer des chaînes quand elles sont au même
> endroit,
> cela risque de faire paginer.

???
3 Comments
  Re: opérateur         


Author: Laurent Deniau
Date: Dec 27, 2006 08:48

Pascal Bourguignon a écrit :
> Il n'y a pas de tableau ni de chaine de charactères en C. Il y a
> seulement des pointeurs.

Aie, mal aux yeux de lire ca.

6.2.5 Types

6.2.5-20
- An array type describes a contiguously allocated nonempty set of
objects with a
particular member object type, called the element type.36) Array types
are
characterized by their element type and by the number of elements in
the array. An
array type is said to be derived from its element type, and if its
element type is T, the
array type is sometimes called ''array of T''. The construction
of an array type from
an element type is called ''array type derivation''.
Show full article (1.26Kb)
no comments
  Re: opérateur         


Author:
Date: Dec 26, 2006 02:56

Dans l'article <45907404$1_1@news.bluewin.ch>,
Yves Lange écrit:
> où est l'erreur ?
> #include
> main(){

int main (void)
> char a[10] = "abc";
> char b[10] = "abc";
> if (a == b){
> printf("A == B");
> }
> else{
> printf("B != A");
> }
> return 0;
> }

Peut-être un \n à la fin des chaîne dans les printf.
Maintenant, tu devrais obtenir

B != A
Show full article (0.81Kb)
no comments
  To the preprocessor experts         


Author: ludovicd
Date: Dec 25, 2006 07:45

Hi,

As many, I'm looking for a more efficient use of the C preprocessor.
The gcc manual specifies:

"The macro's body ends at the end of the `#define' line. You may
continue the definition onto multiple lines, if necessary, using
backslash-newline. When the macro is expanded, however, it will all
come out on one line. For example,

#define NUMBERS 1, \
2, \
3
int x[] = { NUMBERS };
==> int x[] = { 1, 2, 3 };

The most common visible consequence of this is surprising line numbers
in error messages.

There is no restriction on what can go in a macro body provided it
decomposes into valid preprocessing tokens. Parentheses need not
balance, and the body need not resemble valid C code. (If it does not,
you may get error messages from the C compiler when you use the macro.)
"
Show full article (1.81Kb)
no comments