C++/c++

Advertisement


Question
when i m running this code it is taking input of all the information but it is showing library card no. which i find out with the help of lcrd_st().
sir can u please tell me what is problem in this code and how can i overcome this problem?
#include<stdio.h>
#include<iostream>
class addrecord
{
char name[20],rno[10],str[10];
void lcrd_st()
{
char str1[9];
int i;
for(i=0;i<8;i++)
str1[i]=rno[i];
for(i=0;str1[i]!='\0';i++)
str[i+1]=str1[i];
str[0]='L';
puts(str);
}
public:
void getdata_st()
{
cout<<"\n enter name";
gets(name);
cout<<"\n enter roll no";
gets(rno);
lcrd_st();
}
void main()
{
addrecord rd;
rd.getdata_st();
}


Answer
Hi dear Ankita !

 ive just went through your code , i couldn't come to a conclusion what you are trying to do with the name and the roll number because ur question wasn't much clear, Kindly let me know the code objective of your program or explain me the question , hopefully ill answer in the best possible way.

Thanks and Regards!
Prince M. Premnath  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise

Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)

Experience

More than 5 years

Education/Credentials
MCA

©2016 About.com. All rights reserved.