class foo {
public:
static int func(const char*& p) const;
};
This is illegal, why?
Answer Posted / john gummadi
There is nothing to do with class members here, we don't
see any. The function takes a constant pointer as a
parameter, when it is constant it cannot be changed
(although technically we can change by casting), then you
cannot use reference (&).
But who knows, compilers may accept, I haven't tested.
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is variables in c?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is a program flowchart and explain how does it help in writing a program?
Is it better to use a macro or a function?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
What are examples of structures?
What is .obj file in c?
List some of the dynamic data structures in C?
What are the header files used in c language?
what is stack , heap ,code segment,and data segment
largest Of three Number using without if condition?
Which is more efficient, a switch statement or an if else chain?
What are the properties of union in c?
Why does not c have an exponentiation operator?