Perhaps I'm not explaining correctly - but I do actually want the actual carriage return (0xD) character. I have a function that does newline characters, now I just need it to do carriage return (and...
Type: Posts; User: JizJizJiz
Perhaps I'm not explaining correctly - but I do actually want the actual carriage return (0xD) character. I have a function that does newline characters, now I just need it to do carriage return (and...
Yup, I am using binary mode to read the line.
Thanks bud.
Ah, if getline() ignores line delimiters, that may be why my original method isn't working...is there something else I should try using?
I think I'm confusing myself to death, and in the process, everyone else too. I'm sorry :P. I kinda feel like an idiot now.
So essentially, I'm writing a program that works on both Windows and...
Well, I parse the user's input. Say the user writes: "Line 1\c" - what I actually pass to the function that does the file searching is: "Line 1\r"
I think this works, right?
The text file itself would have the actual new lines. So like, it would look just like what I posted above. However, say a customer wanted to search for a carriage return following a word, such as...
We're using it as the carriage return character. As I understand now, the C++ representation of character 13 is \r. In our program, the user would type "\c"
Thanks.
Please forgive my awful explanation. So here it is, I'll attempt again:
Essentially, I'm looking for occurrences of a particular string within a line. For example, imagine the following file:
...
Sorry :o.
Bump :(.
Yeah, I should've done that in the previous post:
else if (contains[contains.size() - 2] == '\\' && contains[contains.size() - 1] == 'c')
{
string::size_type pos = contains.find("\\c");...
I did this, and it still didn't work :(.
Yup. I have this working for the \t tab character, just not for the new lines.
Thanks guys. I'll take a look.
Thanks guys. I may be a bit dense here, but I'm not sure how I can implement that. Any leads?
Thanks again.
Hm, are you sure? I'm looking at the table here http://www.lookuptables.com/ and it seems like it's 15, 0xD?
I just used \c as an example in the input. For example, it takes "1\c" as the input and...
Hi all:
I'm trying to write a few lines of code that will take a line of input and replace an instance of "\c" with the carriage return character 0xD, and then search a document for that line of...
Good point. That fixed it :o.
Hi:
So I'm trying to match a string against a wildcard to see whether they match. I'm using a snippet found here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1680&lngWId=3...
Awesome. Thanks bud.
Ah, that works. Good thinking.
I'm going to use that for now. However, I do recall a more elegant way of doing it (by formatting the number before printing, perhaps?). Just for my personal...
Hi all:
Is it possible for an int to print a specific number of digits every time?
For example:
int x = 1;
cout <<x <<endl; //should print 001
x = 999;
It seems like I can't even try to treat every item inside a directory as a file and get the contents of the subdirectory using the stat header :(.
Hi all:
I'm currently using the stat header, and things look to be OK. One problem - it doesn't seem to recognize subdirectories as directories.
For example, if we have C:\asdf\etc\dfg, asdf...