We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

# CS201 Assignment No. 02 Solution & Discussion Due Date: 27-01-2014

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 6449

Attachments:

Replies are closed for this discussion.

### Replies to This Discussion

Ghulam Fatima Asghar

put the double less than sign after every cout...

like this..

isme eror hai dear k cout" thn agy ati hai ju dsplay krna huu....

cout k agy less the k 2 sign missng han

Dear Students,

all solutions r correct. errors r occur just due to missing less than sign every cout.

Coz, Here less than signs do not show when code is pasted.

so, no need to worry... if facing any error in coding, just paste here. 'll try to do it correct.

کزہ u r Most welcome..

plzzz yah chk kar k batyn thk hai yah ni

Attachments:

#include<iostream.h>
#include<conio.h>
class myClass
{
private :
char*str, alphabet;
public:
myClass()
{
str = new char[10];
cout"Default Constructor is called ..... and default id is bc110401299 \n";
}
void setId(char *id)
{
str = new char[10];
strcpy(str,id);
}
char * getId()
{
return str;
}
void countfunction()
{
cout"\nEnter letter you want to count: ";
cin>>alphabet;
int i =0, count = 0;
while(str[i] != '\0')
{
if(alphabet == str[i])
{
count++;
}
i++;
}
cout"The total letters "alphabet" in your student id : "countendl;
}
~myClass()
{
delete[]str;
cout"\nDestructor called ...... and object has destroyed \n";
cout"Press any key to continue ..... ";getch();
}
};
main()
{
myClass obj;
obj.setId("bc110401299");
obj.countfunction();
}

strcpy(str,id);

[Error] 'strcpy' was not declared in this scope

u missed in coding

using namespace std;

write it as above

#include<iostream.h>
#include<conio.h>

using namespace std;

can any one tell me please when i run program i am facing this error how to resolve it ?

write just..

#include<iostream>

#include<iostream.h>

but error a raha hy #include<iostream.h> kea hy phr b system says 1 21  [Error] iostream.h: No such file or directory

1

2

3

4

5

## Latest Activity

6 minutes ago
10 minutes ago
10 minutes ago
+ M.Tariq Malik added a discussion to the group MCM531 Community Journalism

10 minutes ago
14 minutes ago
18 minutes ago
20 minutes ago
20 minutes ago