|
Let Me Google That For You.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Google gives the solution in php program, but I want in c-code
|
|
|
|
|
Damn you google! :shakes fist:
|
|
|
|
|
krish_kumar wrote: but I want in c-code...
Which is exactly what was provided to you.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Google's first hit: "How to validate IP address in C"...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I would like to know if there are some good tools available to get the reverse engineered diagrams given
a set of files under a legacy project that needs to be reused and refactored.
It would be great if someone categorizes into Freeware open sources ones and that which comes with a cost.
|
|
|
|
|
Can't beat IDA Pro[^] with the decompiler plugin. screen shot[^]
There's a demo available. The disassembler and the decompiler pair will set you back about $3800 USD.
|
|
|
|
|
error LNK2005...already defined
While building my code in VS2008 I am getting a build error: error LNK2005...already defined in ....
1>Linking...
1>Main.obj : error LNK2005: "unsigned char * X1" (?X1@@3PAEA) already defined in BC.obj
1>Main.obj : error LNK2005: "char * X2" (?X2@@3PADA) already defined in BC.obj
1>Rs.obj : error LNK2005: "unsigned char * X1" (?X1@@3PAEA) already defined in BC.obj
1>Rs.obj : error LNK2005: "char * X2" (?X2@@3PADA) already defined in BC.obj
In my project I have three .h files:
1) Common_Definitions.h
unsigned char X1[16];
char X2[4];
struct xyz
{
UINT32 X3;
unsigned int X4[4];
long X5;
int X6;
int X7;
};
2) BC.h
3) RS.h
I have three .cpp files
1) Main.cpp
2) BC.cpp
3) RS.cpp
In Common_Definitions.h I have definitions/declarations which I want to be available in entire project, While BC.h and RS.h has corncenred variables.
I have included Common_Definitions.h in BC.h and RS.h.
#ifndef Common_Definitions_h
#define Common_Definitions_h
#include "Common_Definitions.h"
#endif
I have included BC.h and RS.h in their corresponding .cpp files.
I have included BC.h and RS.h also in Main.cpp
Now while building I get the linker error LNK2005.
How to resolve it?
Earlier when I had included Common_Definitions.h in BC.h and RS.h directly without ifndef.
#include "Common_Definitions.h"
then it was giving compilation error:
1>d:\...\common_deFINITIONS.h(18) : error C2086: 'unsigned char X1[16]' : redefinition
1> d:\...\common_deFINITIONS.h(18) : see declaration of 'X1'
1>d:\...\common_deFINITIONS.h(19) : error C2086: 'char X2[4]' : redefinition
1> d:\...\common_deFINITIONS.h(19) : see declaration of 'X2'
1>dd:\...\common_deFINITIONS.h(22) : error C2011: 'XYZ' : 'struct' type redefinition
1> d:\...\common_deFINITIONS.h(22) : see declaration of 'XYZ'
So to resolve that I have included Common_Definitions.h in BC.h and RS.h using ifndef.
#ifndef Common_Definitions_h
#define Common_Definitions_h
#include "Common_Definitions.h"
#endif
But this is leading to linker error.
Please let me know how to resolve this compiler and linker issue?
|
|
|
|
|
You should try to instance any objects
in the *.cpp file(s) only...
When you will want to share any defined variables by other files -
just use "extern" definition:
...
char* pchTest("test");
...
extern char* pchTest;
...
virtual void BeHappy() = 0;
|
|
|
|
|
Thanks Eugen for the reply.
In my case I have one var X1 in a .h file.
I want to use this X1 in three other .cpp files, then how should I declare and define it?
|
|
|
|
|
It could be made as following :
...
...
...
unsigned char X1[16];
...
...
extern unsigned char X1[16];
...
...
extern unsigned char X1[16];
...
(The answer would be different
when you would like to share a type (not an instance),
but the X1 is an instance (not a type)... )
virtual void BeHappy() = 0;
|
|
|
|
|
ok thanks
this clarifies it all.
Also presently I did not declare the variables as extern in the header/cpp files.
But I included the declaration of header files as:
Declaration for common_definitions.h, bc.h and rs.h is now changed as:
#ifndef bc_h
#defibe bc_h
-----declaration of bc.h
#endif
#ifndef rs_h
#define rs_h
-----declaration of rs.h
#endif
This also resolved the issue.
|
|
|
|
|
You are welcome !
PS. you could also use:
#pragma once
...
PPS. if you need an own instance in your *.cpp you could also use:
#pragma once
...
typedef struct s {
int m_iVar1;
int m_iVar2;
} myS;
typedef UCHAR myBuffer[16];
...
...and then :
...
#include "CommonSettings.h"
...
myBuffer ownBuffer;
...
...
#include "CommonSettings.h"
...
myS ownS = {0};
virtual void BeHappy() = 0;
|
|
|
|
|
|
Hi i am using VC7 and i want to connect mysql 5.1 through odbc driver mysql 5.0.
i have conncect database by cdatabase class . after successfuly open the database we called open method of Crecordset but it give exception.
CRecordSet rs(m_db);//
rs.open(CRecordSet::Dynaset,"Select * form Tablename",CRecordSet::none);
above line guve exception aboiut dynaset. we are unable to call open function of Crecordset.
but CRecordSet::snapshot work fine.
|
|
|
|
|
Please check CDBException::m_strError : it should give you useful info about the problem.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i got proper exception in case of "Creordset::dynaset".
How can call open method of Crecordset with Creordset::dynaset to fetch record from Mysql
|
|
|
|
|
shivanandgupta wrote: i got proper exception in case of "Creordset::dynaset".
What is 'proper exception'?
Why didn't you report the erreor message?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello people!
If i want to encrypt some data based on a key (password) and want to keep the encryption as irreversible without the key as possible (yeah, i know, that's the point), which algorithm would you recommend? The data itself would mostly be text and only 1-2 megabytes tops, so if the choice is between safer or faster, i'd choose safer. Thanks for your oppinions.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
For encrypting that much data (1-2 MB) you must use any symmetric algorithms like RC2, RC4, or Data Encryption Standard (DES)
|
|
|
|
|
Thank you, i will check these out.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Don't use DES any more! Its not safe because the key is only 56 bit long. You can "hack" it, with some good machines in under a day!
Use AES (128-256 bit) (Advanced Encryption Standard) or maybe, if AES not available, 3DES instead.
Greetings
Covean
|
|
|
|
|
Btw are these freely usable?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
In .NET there are some crypto provider you can use for "free" for example 3DES / TripleDES.
.NET 3.5 also introduced AES.
I don't know if there are also libs for C++ but I can't imagine that there aren't some in the internet (for free). If you don't find anything about AES look for Rijndael its the same algorithm.
Greetings
Covean
|
|
|
|
|
Thank you very much.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|