www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

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

Views: 6491

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

Top Trends

1

2

3

4

5

+ ₱ɆⱤ₣Ɇ₵₮ ҉S҉M҉O҉K҉ER ⱫɆⱠⱠłsH ♥♥

------------------------------------

Latest Activity

Zulfiqar Hussain liked Wɐsooɯ ᴚɐuı's profile
6 minutes ago
9 minutes ago

23 minutes ago
38 minutes ago

@@@@ Mera dill bra roya h;;;;;

41 minutes ago
Wɐsooɯ ᴚɐuı updated their profile
44 minutes ago

1 hour ago

1 hour ago