Sponsored Content
Top Forums Programming Need help in character pointer Post 302236222 by spirtle on Monday 15th of September 2008 04:42:58 AM
Old 09-15-2008
Quote:
Originally Posted by jim mcnamara
spirtle -
Code:
char x[10]={0x0};

According to C99 standard all of the 10 elements of x are set to zero.
Fair enough! Unfortunately, I have to work with stone-age C, so I tend to overlook these fancy modern features.
 

10 More Discussions You Might Find Interesting

1. Programming

pointer

void main() { int a={1,2,3,4,5,6,7,8,9,10}; int *p=a; int *q=&a; cout<<q-p+1<<endl; } The output is 10, how? if we give cout<<q it will print the address, value won't print.... if we give cout<<p it will print the address, value won't print.... p has the base addr; q... (1 Reply)
Discussion started by: sarwan
1 Replies

2. Programming

why we never delete a pointer twice

can u tell me the reson that why we should not delete a pointer twice.? if we delete ponter twice then what happen and why this happen Regards, Amit (2 Replies)
Discussion started by: amitpansuria
2 Replies

3. Programming

far pointer

what is far pointer in C (1 Reply)
Discussion started by: useless79
1 Replies

4. Programming

pass a pointer-to-pointer, or return a pointer?

If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it: (1) one is to pass a pointer-to-pointer parameter, like: int my_malloc(int size, char **pmem) { *pmem=(char *)malloc(size); if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 Replies

5. Programming

matrix pointer

Can anyone tell me what the following statements do? float (*tab); tab=(float (*)) calloc(MAXCLASS, (MAXCLASS+1)*sizeof(float)); (3 Replies)
Discussion started by: littleboyblu
3 Replies

6. Programming

C dynamic pointer

Hi, Can anyone tell me how i can declare and allocate dynamically an array of pointers to structured type?? Is declaration something like this:? struct_name ** array; (1 Reply)
Discussion started by: littleboyblu
1 Replies

7. Programming

Pointer to pointers

Hi guys, I'm trying to understand pointers in C and made a simple example and I've problems with It. Can someone help? #include <stdio.h> #include <stdlib.h> #include <assert.h> int f1(char **str_); int main(int argc, char **argv) { char *str = NULL; f1(&str); ... (3 Replies)
Discussion started by: pharaoh
3 Replies

8. Programming

pointer problem

Does anyone know? int x = 1; int *p = &++x; //ok ! int *q = &x++; //gives an error :O why the first pointer is ok but the second is an error? (13 Replies)
Discussion started by: nishrestha
13 Replies

9. Programming

Pointer confusion

Here are two programs that pass a pointer to a variable but behave differently. Shouldnt the i in second program be 0 after the function call? #include<stdio.h> void changeI(int *i) { *i = 10; } int main(void) { int i=5; printf("%d before\n", i); changeI(&i); printf("%d... (1 Reply)
Discussion started by: dragonpoint
1 Replies

10. Programming

Character pointer to Character array

how to copy content of character pointer to character array in c programming.. char *num; char name=num; (1 Reply)
Discussion started by: zinat
1 Replies
mbtowc(3int)															      mbtowc(3int)

Name
       mbtowc - converts a single multibyte character into a character of type wchar_t

Syntax
       #include <stdlib.h>

       int mbtowc (pwc, s, n)
       wchar_t *pwc;
       const char *s;
       size_t n;

Arguments
       pwc     The pwc argument is a pointer to the resulting object of type wchar_t.

       s       The s argument is a pointer to a multibyte character.

       n       The n argument is the maximum number of bytes of object s that are examined.

Description
       If  s  is  not  a null pointer, the function determines the number of bytes that comprise the multibyte character pointed to by s.  It then
       determines the character code for the value (of type wchar_t) that corresponds to that multibyte character (the value of  the  code  corre-
       sponding to the null character is zero). If the multibyte character is valid and pwc is not a null pointer, the function stores the code in
       the object pointed to by pwc.  At most n bytes of the array pointed to by s are examined.  This function is affected by the LC_CTYPE  cate-
       gory of the current locale.

Return Values
       If s is a null pointer, the function returns a zero value.  If s is not a null pointer, the function returns:

	  o  0, if s points to the null character

	  o  The number of bytes that comprise the converted multibye character, if the next n or fewer bytes form a valid multibye character

	  o  - -1, if the next n or fewer bytes do not form a valid multibye character

       In no case is the value returned greater than n or the value of the MB_CUR_MAX macro.

See Also
       mblen(3int), mbstowcs(3int), setlocale(3int), wctomb(3int), wcstombs(3int)

																      mbtowc(3int)
All times are GMT -4. The time now is 04:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy