i am using a c library from c++ application and i need to fill a c struct from c++ code, this is a c++ console application. it doesnt seem to work when i assign variable values using cin. what should i do ?
serkan sendur 821 Postaholic Banned Featured Poster
Recommended Answers
Jump to Postpost representative code.
Jump to PostEven if you use the C version of declaring struct instead of the C++ version, I still think it would work. However, post the declaration of bookrec just to be sure.
This should work fine:
cout << "id_code :" << endl;
cin >> bookrec.id_code;assuming …
Jump to PostAssuming you have declared bookrec like this:
info bookrec;
Then using >> to input information into the member variables is an option. If none of the strings will contain embedded whitespace, then it may even be the best option. If the strings representing the member variables can have …
All 10 Replies
Lerner 582 Nearly a Posting Maven
serkan sendur 821 Postaholic Banned Featured Poster
Salem 5,265 Posting Sage
Lerner 582 Nearly a Posting Maven
serkan sendur 821 Postaholic Banned Featured Poster
Lerner 582 Nearly a Posting Maven
serkan sendur 821 Postaholic Banned Featured Poster
serkan sendur 821 Postaholic Banned Featured Poster
serkan sendur 821 Postaholic Banned Featured Poster
cikara21 37 Posting Whiz
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.