|
|
Hey folks,
I'm using C++ & MFC (no .NET).
I need to accomplish the following, and I really don't know how to go about any of it. If you know of links/ways to do it
1) Go grab an XML file on the server, and download it, saving it to disk (if necessary) or justu loading it into memory.
2) Parse the xml files and figure out the URIs that exist
3) Go to each URI and then download *all* content viewable on the webpage (images, etc...) so offline viewing is enabled.
4) Be able to send XML log files back to the server
5) I can catch all this stuff on the web site, these are more about C++ & Windows development.
Thanks very much in advance!
|
|
|
|
|
|
you can use a crawler to fetch those xml files.There are many xml parsers available.microsoft has provided a toolkit called msxml which is able to parse xml files.
|
|
|
|
|
Are there any C++ libraries available for parsing XML? I'd eventually like to deploy on other platforms, and I'd like to minimize Windows dependencies if possible.
Although if its easier with Windows libraries, I'll gladly use them.
-chasetoys
|
|
|
|
|
i am trying to do this:
code>
char *ID;
ID = new char[size];
cout<<"Please input your ID"<<endl;
int abc="10;
ID" =="" "c"="" +="" abc;=""
="" i="" am="" trying="" to="" store="" the="" data="" as="" <big="">c10 meaning by conbinig a int and an c together as an string anyway to do this? or sugesstion?
|
|
|
|
|
Hi,
If you are using MFC , try this:
char *ID;
CString szString;
int abc = 10;
szString.Format("c%d" , abc);
ID = new char[szString.GetLength() + 1];
strcpy(ID , (LPCTSTR)szString);
If you are not using MFC , try this:
char *ID , Buffer[20] , temp = 'c';
int abc = 10;
_itoa( abc , Buffer , 10 );
ID = new char[strlen(Buffer) + 1];
ID[0] = 'c';
strcat(ID , Buffer);
With best regards,
Eli
|
|
|
|
|
itoa( abc , Buffer , 10 ); <== wat does this do?
to use this need to include any special things?
|
|
|
|
|
itoa(MSDN) -->Convert an integer to a string
int abc=10;
TCHAR Buffer[50];
itoa( abc , Buffer , 10 );->then Buffer==10
whitesky
|
|
|
|
|
i tryed it but it says itoa is an undeclare variable
currently i using these include:
<br />
#include"iostream.h"<br />
#include"string.h"<br />
#include"iomanip.h"<br />
-- modified at 4:10 Sunday 21st May, 2006
|
|
|
|
|
please test this code,it work
<br />
#include "stdafx.h"<br />
#include <iostream><br />
#include <tchar.h><br />
using namespace std;<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
TCHAR Buffer[50];<br />
itoa(10,Buffer,10);<br />
cout<<"Value is="<<Buffer<<"\n";<br />
return 0;<br />
}<br />
can you show your code how to use itoa
whitesky
|
|
|
|
|
<br />
#include"iostream.h"<br />
#include"string.h"<br />
#include"iomanip.h"<br />
<br />
char *ID;<br />
ID = new char[size];<br />
char Buffer[20] , temp = 'c';<br />
int abc = 10;<br />
itoa( abc , Buffer , 10 );<br />
ID = new char[strlen(Buffer) + 1];<br />
ID[0] = 'c';strcat(ID , Buffer);<br />
this is my code
by the way #include "stdafx.h" dosnt seems to work i am using visual c++
also the other 2 include in your previosu example cant be seen >.<
|
|
|
|
|
#include "stdafx.h"
#include iostream use ">"
#include tchar.h
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char *ID;
ID = new char[50];
char Buffer[20] , temp = 'c';
int abc = 10;
itoa( abc , Buffer , 10 );
ID = new char[strlen(Buffer) + 1];
ID[0] = 'c';strcat(ID , Buffer);
cout<<"Value="<<buffer<<"\n";
return="" 0;
}
=""
<font="" size="2" color="#99ff66">
whitesky
|
|
|
|
|
|
char *ID;
char Buffer[20];
int abc = 10;
itoa( abc , Buffer , 10 );
ID = new char[strlen(Buffer) + 2];
ID=Buffer;
strcat(ID ,"c");
cout<<"Value="<<id<<"\n";
<font="" size="2" color="#99ff66">
whitesky
|
|
|
|
|
i hope i am not troubleing u >.<
now the output is 10c i am trying to get c10 >.<
i already tried this:
ID="c";
strcat(ID ,Buffer);
got error...
|
|
|
|
|
well ok i mistake i think your problem is itoa so its easy use
<br />
<br />
#include "stdafx.h"<br />
#include windows.h<br />
#include iostream<br />
#include tchar.h<br />
using namespace std;<br />
<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
char *ID;<br />
char temp = 'c';<br />
int abc = 1240;<br />
ID = new char[sizeof(ID)];<br />
<br />
wsprintf(ID,"%c%d",temp,abc);<br />
<br />
cout<<"Value="<<ID<<"\n";<br />
return 0;<br />
}<br />
<br />
<br />
whitesky
|
|
|
|
|
i dont quite understand
my objective is actually to store the lettle "C" and an int into a string so the coutcome will become like this C10 or C203
curretly the include i am using are
#include"iostream.h"
#include"string.h"
#include"iomanip.h"
i not allowed to use namespace std haha >.<
so can anyone try help me ?
|
|
|
|
|
Instead of strcat() in my first answer , use the memcpy().
I tested this code and it's working:
char *ID , Buffer[20];
int abc = 10;
int nLen = 0;
_itoa( abc , Buffer , 10 );
nLen = strlen(Buffer);
ID = new char[nLen + 2];
ID[0] = 'c';
memcpy(ID + 1 , Buffer , strlen(Buffer));
ID[nLen + 1] = '\0';
Eli
|
|
|
|
|
i tryed it with include"iostream" it works but it dosnt work in include"iostream.h"
do i have to include nay additional stuff??
by the way i say thx to all those who have helped me in advance =)
really help a lot
|
|
|
|
|
this code==> _itoa( abc , Buffer , 10 );
i tryed it with include"iostream" it works but it dosnt work in include"iostream.h"
do i have to include nay additional stuff??
by the way i say thx to all those who have helped me in advance =)
really help a lot
|
|
|
|
|
I think your problem is solve.
Can you explain what do you need exactly,please?
whitesky
|
|
|
|
|
yes my problme is solve but i cant use this function -->_itoa( abc , Buffer , 10 );
the itoa part dosnt work unless i use include"iostream" but i am using include"iostream.h"
so i am just asking there is anything else to include so that i may use include"iostream.h"
together with the itoa function
|
|
|
|
|
neodeaths wrote: so i am just asking there is anything else to include so that i may use include"iostream.h"
together with the itoa function
Yes, the prototype of the _itoa function is present in the stdlib.h header file
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I rated you 1 -- it would be quicker for you to check MSDN library than to ask on CodeProject what itoa does.
|
|
|
|