Hi,
Hi I am sorry if its not the right place to put the question.(I'll request modeartor to put it to right place, but i think we dont have a subforum to testing c++ program).
Coming to my...
Type: Posts; User: Alexpo
Hi,
Hi I am sorry if its not the right place to put the question.(I'll request modeartor to put it to right place, but i think we dont have a subforum to testing c++ program).
Coming to my...
So finally, the answer to the question "Can we have data abstraction in C?" is YES.
The data type like Stack, Queue...etc are perfect examples of data abstraction and those all are well...
Thanks Anon,
exactly....obj and obj2 are pointers not instances of MyString.
how stupid sometime a person can get. :mad:
#include "stdafx.h"
#include <iostream>
using namespace std;
class MyString
{
public:
MyString(const char *str="")
{
hi,
can we say "this" pointer is a part of the object in question or it is something created by compiler outside the object to store address of the object?
i think it is not the part of it....
Yes, the code compiles, but doesn't execute.Throws exception.
Thanks Elysia,
Especially the extra thing, you made me know that " _" is used for language implementation.
And would you pls, let me know where can i find more precise technical info about "how...
I have seen wide use of the following type of
String _name;
_name = 0; in the book inside c++ object model (By Lippman).
though my compiler VC++ 8 does not allow the code to compile
and it...
#include "stdafx.h"
#include <iostream>
using namespace std;
class sample
{
int i;
virtual void fun(){};
};
Here is the code
class Someclass
{
private:
SomeOtherclass* p;
public:
Someclass()
{
Hi Elysia,
Got the point.Thanks.
Hi Mats,
Thanks for this info. beacuse I was confused it to be data or code section.As somewhere I read it as code section and some where as data section.
Hi San_Crazy & all,
.
Its true that we don't know the size of memory pointed by "pa" but the folloing code is also woking fine
void fun(char *pa)
{
pa="Mystring";
Thanks QuantumPete,
Would you please name the special area of memory(if it having).Its an area in memory (from code segment or from data segment ) where all constant data are stored, right? ...
#include "stdio.h"
void fun(char *pa)
{
strcpy(pa,"MyString");
}
int main()
{
Hi,
There are some questions regarding dll and library .
I know,static library files are linked statically by linker at start up.On the other hand dll was used to link the required...
Hi All,
We can not access the data member of a class nested with in another class.It does not get instantiated also.So what are the use of having a class nested with in another class?
Thanks...
Here is a class
class MyClass{
private:
SomeClass* sc;
public:
MyClass()
Hi,
name of array gives us the base address always.
so, in the code below:
int arr[]={1,2,3};
printf("%p:%p", arr+1,&arr+1);
You are right dwks..its compling with out error with .c extension.
I got the point from yours and Elysia's reply.
Thanks to u both,
A
Does following code compile in any compiler ?
...
int * p,*q;
void *vp;
int a=5;
p=&a;
vp=p; // I know this perfectly ok
Thanks Elysia and Mats.
Its realy a weired expression and only ok in books teaching different (and complex)way of doing things and should be avoided in reallife coding.
Regards,
--A
Hi,
I came across such an expresiion from a C book..whose explanation was not there.
*ptr="SomeChars"[var1%var2] ?
Here ptr is pointer to char and var1 and var2 are two int varible.
I am...
Thanks for ur reply.
Will you please tell me how to acess that data members.
I was using those kinds of name just to convey the idea.
The real life problem may be like this:
I have a...
Hi ,
I am a beginner in C++.
I want to know how can we access data member of a class from another class. I am facing problem in visualizing the things in writing separate .h and .cpp file.
...