|
This should get you close. You can make the necessary changes and organize it a bit better.
FILE *pFile = fopen("C:\\!conMania Collection\\list71.txt", "rb");
if (NULL != pFile)
{
fseek(pFile, 0, SEEK_END);
long lSize = ftell(pFile);
fseek(pFile, 0, SEEK_SET);
char *pBuffer = new char[lSize];
fread(pBuffer, sizeof(char), lSize, pFile);
fclose(pFile);
for (int x = 0; x < lSize; x++)
{
if (pBuffer[x] == ' ')
pBuffer[x] = '\n';
}
pFile = fopen("C:\\!conMania Collection\\list71_temp.txt", "wb");
if (NULL != pFile)
{
fwrite(pBuffer, sizeof(char), lSize, pFile);
fclose(pFile);
}
delete [] pBuffer;
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Don't you need replace with a \r\n ?
|
|
|
|
|
I don't know. It's not my project. Given that \r is a carriage return and \n is a line feed, I'm not sure what a "line return" is.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
this needs a lot of polish, but it does the bare essentials.
in_filename and out_filename could be selected using CFileDialog. they are hard coded here.
#include windows.h
#include string.h
#include stdio.h
main()
{
FILE *infile_p; // pointer for read file
FILE *outfile_p; // pointer for write file
int byte;// var for byte read from file
if ((infile_p = fopen("in_filename", "r"))==NULL) // open file for read
{
exit(0);
}
if ((outfile_p = fopen("out_filename", "w"))==NULL) // open file for write
{
exit(0);
}
while (!feof(infile_p)) // end of file test
{
byte = (fgetc(infile_p));
if (byte == 32) // look for a space
{
fprintf(outfile_p ,"%c%c", 0x0d, 0x0a);/ replace it with CR/LF
}
else
{
fprintf( outfile_p, "%c", byte);
}
}
return(0);
}
|
|
|
|
|
Your program worked. However it kept the space after the . at the end of the sentence.
|
|
|
|
|
Here's a C++ solution:
#include <fstream>
#include <string>
using namespace std;
...
ifstream in("in.txt");
ofstream out("out.txt");
string s;
while(is >> s) os << s << endl;
|
|
|
|
|
Hello,
I'm developing an application using Visual Studio 2005. I use MFC and eveything was working (the prototypes, the application layer, eveything) until I set up the integration project. Everything compiled with a lot of warnings. I fixed them (mostly deprecated warnings that I suppress using the _CRT_SECURE_NO_DEPRECATE define).
After fixing the warnings, errors stared to appead from every GUI file it was compiling. The 5 errors that keep coming back are:
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atltime.h(393) : error C3861: '_localtime64_s': identifier not found
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atltime.h(394) : error C3861: 'strftime': identifier not found
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atltime.h(420) : error C3861: '_gmtime64_s': identifier not found
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atltime.h(421) : error C3861: 'strftime': identifier not found
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlcomtime.h(363) : error C3861: 'strftime': identifier not found
I don't know why they appear or how to make them go away. Does anybody have a clue what might be going on?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I don't know why I solve problems just after posting a message here, but it happens everytime I post a problem. Don't get me wrong, but I try several hours if not days before I post a new thread here, but just after that, I find the solution.
The problem was that I have a file called "time.h". This is not the real problem. I specified additional include directories and the MFC file includes <time.h>. The additional include directories cause the compiler to include my time.h instead of the right time.h (the C header). I don't know why my directories have precedance over the standard directories, but I think that MS would say: "This is by design.."
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Bob Stanneveld wrote:
I don't know why my directories have precedance over the standard directories...
It all depends on the form used:
#include "time.h" -- The preprocessor first looks for the file in the same directory of the file that contains the #include statement.
#include <time.h> -- The preprocessor first looks for the file along the path specified by the /I compiler option.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
#include "time.h" -- The preprocessor first looks for the file in the same directory of the file that contains the #include statement.
#include <time.h> -- The preprocessor first looks for the file along the path specified by the /I compiler option.
I know that, but I don't know why an MFC library file includes my Time.h file using the #include <time.h> directive. I thought that directive tells the compiler to look first in the INCLUDE environment variable. Guess it does not.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
How to determinate the memory allocated in a specific dll module.
my software crashed in scilence, the only reason is I loaded too big pictures, and I called some function in specific dll, so I'm wondering how many bytes my dll allocated for me.
thank you !
Best Regards
|
|
|
|
|
One way is to walk the heap-block list. See here for an example.
You could also use performance counters. See here for an example.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks! I read the articles you put here,
I think the heap-block list maybe helpful, but performance counter only give the memory used by process itself, cannot see the dll inside of it.
Best Regards
|
|
|
|
|
Hi all,
I've a question for you. So, for example, i've an ASP file (abc.asp):
<%<br />
Function DB_Connect()<br />
.....<br />
End Function<br />
%>
Now, in an ActiveX, i want call this function. How can i do??
Thanks for your help!
hzocm
|
|
|
|
|
I'm curious why you'd want to. Why not just make the ActiveX code do what the ASP code is doing?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
that's a simple example. But, if u want, i've create an ActiveX what uses the interface of portail web (already is existed). This activeX will be install in client PC. The VBScritp function uses a ODBC link that connects to a server Database.
thanks for your replie
hzocm
|
|
|
|
|
So the ActiveX control is running on the client and the ASP code is running on the server. The database also resides on the server. Correct?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hai Guys,
Thanks Osama for the reply. I got the Answer.
I have a major problem on Updating data from two or more tables in Visual C++ Database programming. I have looked at table joins they are read only. I want to work with and update data from two or more tables in Visual C++ 6.0.
Can any one be of help.Thanks in advance.
Wisdom.
|
|
|
|
|
As you have already discovered, joined tables are read-only. You'll need to update each table separately.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello Everyone!
I need to access data from XML file with regular database interface.
So that I can use SQL like syntax for accessing data.
(I am working on VC++ 6.0 & Oracle database)
I searched for it & came to know that there is something like ODBC driver for XML.
Someone please tell me where to find any such driver( free ).
& also how to use that.
If anybody have other solution , that will be good.
With Regards
Abhi
|
|
|
|
|
Hi
Is it possible to add buttons to balloon tooltip?
Regards
|
|
|
|
|
Asha Udupa wrote:
Is it possible to add buttons to balloon tooltip?
Ms. Udupa,
Check, if this article of any help :-
http://www.codeproject.com/miscctrl/pptooltip.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I'm (proactively) checking my code against VC8 Beta 2, to find any porting issues.
VC8 uses strsafe.h and "tuned" C Runtime headers, that flag the "old" C string APIs as deprecated, and encourages use of the (safer) "_s" - variants.
Is there any header that allows to compile such code on other compilers (VC7, or MyOwnHomeGrownSeePlusPlusThingie)?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
some one can recommend a free MFC library that can generate barcodes with types: code-39, code-128, code-2 of 5, EAN-8 and EAN-13
Thanks a lot.
|
|
|
|