lol thnx its working now but like this
while (strcspn(Book.name,"qwertyuiopasdfghjklzxcvbnm1234567890") != NULL || ( strlen(Book.name) < 4 ))


hahahaha now
can u tell me is it possible to calculate the number of books in the librery by suming up all the copies ?
i tried to put
int sum;
int total; ( both of them not in struct)
and open a new case
total = sum(Book.copies) but it wont work :S

CLS and cls are not distinguished in C and secondly your code is error free.You do need to modify the strings section a bit.

Glad you joined in this thread, but next time please take the time to read the whole thread so that you don't look like such a fool.

hahahaha now
can u tell me is it possible to calculate the number of books in the librery by suming up all the copies ?
i tried to put
int sum;
int total; ( both of them not in struct)
and open a new case
total = sum(Book.copies) but it wont work :S

It didn't work because sum is not a function. And such a function doesn't exist in either c or c++ languages. Maybe you have it confused with the sum function in SQL. The way to do it is to loop through all the books and total up the copies, very much the same way you would do it manually.

CLS and cls are not distinguished in C and secondly your code is error free.You do need to modify the strings section a bit.


Online business administration

umm steve what are u talking about i mean which code . cause there i got 2 types of struct now.

and
thank you for answering i also know my program donot have problem but that is something my lecturer wont agree with me. also he needs more functions and i cannot tell him anything because i really have a low course work . so am working my as better as possible to get a 100% mark on this .
now then while u did have time to reply . i need 2 more things .
1. i need to hide my password to *** . i mean when i type it should view ****.
2. i need to sum up the total records which will be viewed in another selection.( i mean i need to sum up added Book.copies ) ( also its freaking me out because i do not know how to even call it )

i have a idea now
what if i call back the display part again and just show the copies there. can work a bit . but now i cannot relate each records with other how to get that working ? i mean how to get loop work among all the records i added.

i would be real happy if there is a code that can sum up the amounts in screen :D

>> i also know my program donot have problem but that is something my lecturer wont agree with me. also he needs more functions

That is what I was trying to tell you in the very beginning of this thread. You have written the entire program in main(). You need to split it up so that there are several functions.

noooooooooooooooo i donot mean that kind of functions :S
1.he need now a entire new password system ( i wont make it )or the password to view as *** ( am trying to get this working thnx to you i didnt need to go throught everything and fix the problems u fixed for me )
2. he needs me to get the total number of book.
( am pretty sure that when i get total number of book in the library he will as me to do the total price thing) ( even if its on the day of my viva which is this monday)
thank you again :D

i seem not to get anywhere with this new password code . i donot know what is the problem( but i think am mistaking the password part ) hope :D i can get help for this .
thank you in advance again.

Look at the link I posted in this thread. It tells you how to code passwords

i saw that post but i problem here is i have a preset password. and i am unable to get the preset password work with the codes of hiding passwords . i can get *** when i input but i cannot get it matched with my password .
like this

char Text[255];
memset(Text, 0, 255);
for(int i=0; i<254; ++i)
{
char c;
c=getch();
if(c==13)
{
break;
}  else
{
Text=c;
cout<<"*";
}
}

it gives me the output of *** but i cannot connect it to my password ( 123)

>> it gives me the output of *** but i cannot connect it to my password ( 123)

You'll probably find this post enlightening.

yeah i know its enlightening but i have a viva tommrow and i still cannot connect my pass with the code . can any one please help me connecting them :S

now this code i got . this one can show *** but i cannot relate my password with the *** going in. so can any one tell me how can i get my password there.
i mean the text should go as my password but it don goes like that

i just wanted to post this because am writing this same thing in my assignment as acknowledgement

This assignment was something that seemed too hard at the beginning. But I would really like to give thanks to my lecturer for being harsh, what in the end made my do my work as good as I can do. I also like to give thanks to my class mates for helping me with the work. But among all the people I am most great full to Ancient Dragon ( I don’t know his real name ), who helped me through all my toughest parts.

how are you trying to compare the contents of variable Text to 123? Is 123 an integer or character array "123"? If its an integer then you will have to convert Text to integer. if( atoi(Text) == 123)

"123" ... is under a string password.

char Text[255];
memset(Text, 0, 255);
if( atoi(Text) == 123)
for(int i=0; i<254; ++i)

now where can i put that password string . i donot want text there and the int calculations :S i want it plain :S

Reading your original program again you don't need to use atoi. You have to call strcmp() to compare them.

if (strcmp(acc,"abc") == 0 && strcmp(password,"123") == 0 )
	{
		cout << "endl " << endl;
	}

can i please ask the full code from u please . because i have only 5h left :S .... and its 3 am at morning i wana go sleep a bit :S

thank you all for helping me out with this . i submitted it .

but i still want to continue adding features in it .like
how many books in the library. and print out the books information. so if u know which function i can use for them please let me know

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.