10 More Discussions You Might Find Interesting
1. Programming
I am struggling with the pointer to 2D-array (cf: 2D array of pointers). Can anybody help me elaborate how the pointer x moves in the memory to access the individual of y, especially the high lighted lines?
I have talked to one of the curators of the forum, but I am still not quite clear.
Here... (1 Reply)
Discussion started by: yifangt
1 Replies
2. Programming
hi there fellos
could someone teach me how to convert a character pointer into an integer using c
much love (1 Reply)
Discussion started by: surubi_abada
1 Replies
3. Programming
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
4. Programming
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
5. Programming
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
6. Programming
what is far pointer in C (1 Reply)
Discussion started by: useless79
1 Replies
7. Programming
Hi i'm new to c programming and i'm trying to change the address of a pointer/variable but i can't seem to get it right,
I have this
char heap;
char *firstFree = heap;
char *allocMem( int size ) {
void *malloc(size_t sizeofint);
/*allocate space for an array with size... (19 Replies)
Discussion started by: Poison Ivy
19 Replies
8. Programming
Hi,
char *s="yamaha";
cout<<s<<endl;
int *p;
int i=10;
p=&i;
cout<<p<<endl;
1) For the 1st "cout" we will get "yamaha" as output. That is we are getting "content of the address" for cout<<s.
2) But for integer "cout<<p" we are getting the "address only".
Please clarify how we are... (2 Replies)
Discussion started by: sweta
2 Replies
9. Programming
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
10. Programming
I have a class with an integer pointer, which I have not initialized to NULL in the constructor. For example:
class myclass
{
private:
char * name;
int *site;
}
myclass:: myclass(....)
: name(NULL)
{
.....
}
other member function “delete “ the variable before... (2 Replies)
Discussion started by: sureshreddi_ps
2 Replies