Oh yes! I remember reading something like that... i will check it out , that would be better way to answer it. I guess thats what probably the interviewer was expecting!
Type: Posts; User: Shal
Oh yes! I remember reading something like that... i will check it out , that would be better way to answer it. I guess thats what probably the interviewer was expecting!
Hi,
I was being asked a Qn in an interview to sort :
Array, LinkedList, Hashtable, BinaryTree
based on how quickly can u you access an element from them.
I found this question difficult to...
I was going through the Faq- What's the difference between... > '&' and '*' (C++)?
It says:
References cannot have operations performed on them since they are not variables
but if I have...
Is it true that for built in types, pre increment and post increment have no effect on optimization?
i.e i++ and ++i does not optimize the code if "i" were an "int"?
I want to know :
1. what...
Ya, making "str" as an array works! But y does it not work with pointers?
hi,
please see the code below:
void main()
{
int i,len;
char* str = "shalaka";
char temp;
Hi,
I have a class say, "A" which is having a pure virtual function "foo". The function foo is public in class A.
I create another class B, which inherits from A. It defines "foo" as private.
...
Thanks for your response.
Actually my application has to use the ANSI functions because my OS does not support streams.
Made the correction char[8]
I have piece of code which HAS to use the ANSI file functions.
I have a text file which stores 2 values: Address and Data. Its something like :
1 233
48 5.8
I want to extract these...
Thanks for the response!
This always is a confusion for me.
When is it safe and not safe to return reference to a pointer?
Are you suggesting something like this?
.h file:
class CTime
{
public:
CTime(int mn, int hr);
sorry implementing in header makes it work ...but does that make the function inline?
Yes, declaring in header makes it work.. but does that make the function inline?
Hey Sly..
i don't think i missed anything.. btw, did u try compiling the code at ur end? did it work?
oops!!
Now I get the following errors:
maincpp.obj : error LNK2001: unresolved external symbol "public: __thiscall CTime<int>::~CTime<int>(void)" (??1?$CTime@H@@QAE@XZ)
maincpp.obj : error...
implementing in header ... makes the code look bad.. n does that mean that template function becomes inline?
Here is my .h file:
class CTime
{
public:
CTime(int mn, int hr);
~CTime();
How to declare function template inside class?
class CTime
{
public:
CTime(int mn, int hr);
template<typename Any>
void max(Any no);
If I replace
static int count;
with
namespace
{
int count;
}
That was a very gud info.. but i work on a system with memory limitation. I have to think before I allocate every bit of memory.. so if every time the head pointer takes 4 bytes then if my list goes...
Does making the pointer static avoid memory allocation for pointer itself i.e 4 bytes?
In the second reply:
class list {
public:
// Constructors, Destructors, Accessors and...
Hi,
I am trying to implement a double link list using C++ classes (Don't want to use structure).
I declare the following as class private data:
private:
lList *pNext ; // lList...
Y is it bad to use char *?
Thanks . solves my problem...