Category : char

My program is taking string input from the user using fgets() function and I had also tried gets(), scanf("%[^n]s", str) function but still program get terminated at half. Book* create_book() { Book* new_book; char* title; char* author; char* publisher; double price; int stock; printf("nPublisher: "); fgets(publisher, 50, stdin); printf("nTitle: "); fgets(title, 50, stdin); printf("nAuthor: "); ..

Read more

I am trying to use functions of a library that reads and writes from/to streams. To adapt my data to that library, I wanted to use boost::iostreams from boost 1.77.0. Still, a first very simple example does not work as expected. Why? #include <boost/iostreams/device/array.hpp> #include <boost/iostreams/device/back_inserter.hpp> #include <boost/iostreams/stream.hpp> #include <iostream> int main(int, char*[]) { // ..

Read more

Right now I’m downloading a pac file and trying to add to it using a created blacklist. I want the blacklist entries to be entered and split by "," google.ca,Facebook.com I want to split up the entries and reformat them as such d(h,"google.com")||d(h,"facebook.com") Basically I need to read the file I download line by line ..

Read more