OK. Could I just convert between string and char array before/after writing/reading to the file? If I can, how can I convert a char array to a string?
Thanks!
Type: Posts; User: zephyrcat
OK. Could I just convert between string and char array before/after writing/reading to the file? If I can, how can I convert a char array to a string?
Thanks!
I don't need the file to be human readable, but I do need the program to be able to read it and display the information there in human readable form. Right now, when I use the readfromfile function...
I changed my program to use that way of doing things. I had no idea that was possible. (Could I just do that with my plant class?)
Now the name has the correct name followed by a bunch of symbols...
OK. I wrote a read function. Everything works except for the name (the only string.) The name is just blank. I suspect this has to do with what Daved was talking about. Any idea how I can overcome...
tabstop - That makes sense, but then I should be able to add an & in front of waterd.getd() and it should work. Instead, when I do that I get this error:
non-lvalue in unary '&'
Thanks!
Thanks for the help. I got the error I was getting fixed.
Daved - The reason I am using binary rather than text is because, as I understand it, that is required for random access. If that is...
I have a function in a .h file designed to save some information to a file, but I get this error:
error: no matching function for call to `std::basic_fstream<char, std::char_traits<char>...
Thank you! Making the file in advanced solved the problem. I used notepad and choose encoding Unicode, instead of ASCII.
I am working through the book C++ Without Fear and just got to the part where binary files are introduced. I created a program using binary files, but it can never successfully open the file. I tried...
I have two functions, insertNode and makeTree, both of which are supposed to modify the original tree they are being sent, but only makeTree does. Any changes made to the tree I am using in makeTree...
Alright, thanks!
I would like to know how to copy a list so I end up with two separate lists that have the same information in them so that I can modify one without modifying the other.
Thanks!
Thank you! My program works now!
Just out of curiosity and in case I have to do something similar again, how could you do the same thing except by creating a copy of the origional list and than...
My astonishment matches anon's. Are you trying to modify someone else's remove function to do what you want, or what?
No, I am new to C.
Sorry I guess I needed to be a lot clearer. I do want to...
I don't want Return to modify the original list. I guess instead of saying "return" I should have said "print".
tabstop - The problem with doing it that way is that it modifies the origional list....
Sorry, could you give me sme more specifics, I am new to this. Thanks!
I am trying to extract the head from a linked list (and also the tail, but that part works) with the following function:
void Remove (myllist *list){ //remove the head and return the removed node...
Thank you, I fixed that and now my program works.
Hi! I am trying to create a simple program to create a linked list and delete one of the nodes. When I run my program the print out for the "old list" is 4 and the "new list" is nothing. I am not...