This is because &a and &b are not consecutive. (Unless you store it in an array.) Still if you want to proceed, get the difference of address by x = &a-&b. Then do cp+=x. It will work.
But it is not good programing practice. Use array concept.
User Profile
Collapse
-
XML read/write using C
Hi All,
I know, there is a way to write/read xml using a DOM/SAX parser which is coded in C++. (i.e, *.cpp file)
Can we write/read xml using .c file.
Thanks in advance,
Ferdinend -
Hi Danielo,
you have not coded to catch a string exception.
Or you have to code for generic catch.Leave a comment:
-
If you want to display circle only using console I am not sure.
But the alternate way is, you can use GLUT libraries or QT in C++ code.Leave a comment:
-
While solving diamond of death problem how many VTABLE will be created?
class A {};
class B : virtual public A {};
class C : virtual public A {};
class D : public B, public C {};
In this how many VTABLE will be created? And for which classes this VTABLE will be created? -
Question in on const char * const abc..f
Hi Banfa,
Thanks to the reply.
You are absolutely correct about integer. So that only already I have commented the second line of my program.
But, like that I should not able to change the character pointer value also. But I am able to change it. (Refer line number 3 of my program). My moto is I should not able to change the "cStringVal " value....Leave a comment:
-
Usage of const char * const name
In the below mentioned code, my intension is only to use the values which are received as a arguments. But unfortunately, I am able to change the “cStringVa l”. How to avoid this?
...Code:void setValue(const int * const intVal, const char * const cStringVal) { int length=0; //*intVal = 50; //Error Can't change the value //assign the another value strcpy(cStringVal, "India");Last edited by Niheel; Jul 13 '10, 04:36 AM.
No activity results to display
Show More
Leave a comment: