Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to retrieve the user defined data type into main function Pin
Manoj739019-Jun-13 22:54
Manoj739019-Jun-13 22:54 
AnswerRe: How to retrieve the user defined data type into main function Pin
CPallini20-Jun-13 1:57
mveCPallini20-Jun-13 1:57 
GeneralRe: How to retrieve the user defined data type into main function Pin
Manoj739020-Jun-13 18:36
Manoj739020-Jun-13 18:36 
GeneralRe: How to retrieve the user defined data type into main function Pin
Richard MacCutchan20-Jun-13 20:53
mveRichard MacCutchan20-Jun-13 20:53 
AnswerRe: How to retrieve the user defined data type into main function Pin
Richard MacCutchan20-Jun-13 2:09
mveRichard MacCutchan20-Jun-13 2:09 
GeneralRe: How to retrieve the user defined data type into main function Pin
Manoj739020-Jun-13 18:13
Manoj739020-Jun-13 18:13 
GeneralRe: How to retrieve the user defined data type into main function Pin
Richard MacCutchan20-Jun-13 20:38
mveRichard MacCutchan20-Jun-13 20:38 
AnswerRe: How to retrieve the user defined data type into main function Pin
Stefan_Lang24-Jun-13 0:41
Stefan_Lang24-Jun-13 0:41 
Starting at the bottom, your main function doesn't make sense - it's one huge syntax error. Even with all the context and the realisation what this is about (encryption), it's almost impossible to guess what it should do.

Obviously you're not familiar with template syntax. Your attempt to invoke a templated function using a templated type is a syntactical mess. Your data structure definitions contain errors related to incomplete or improper template syntax. For that reason, and because you don't really use or need those template parameters, you should really forget about them!

Since you claim you do need the template, use a const instead: in most cases, where people think they need a template, a global/static definition works just as well:

C++
const int P = 263;


Start with your struct definition:
C++
struct encrypt_data_t {
  EllipticCurve<P>::Point Pa;
  FiniteFieldElement<P> c1;
  FiniteFieldElement<P> c2;
};

There: no typedef required, no template parameters required. Also, since the definition is within your namespace, no need to explicitely add the prefix "Cryptography::".

Next, remove any remaining template parameter definition line in your code: if you always used P as the template parameter name, everything should compile after removing the template <argument list>.

Last: fix your main(). I have no idea what your intention is, but you do call a function that returns a struct, and apparently try to assign that struct to an int. That doesn't make sense. Fix it, or at least remove that assignment, so you can find out and fix any remaining syntax errors. Besides, you omitted the return type for main() (always int), and your main didn't return a value. Both should be listed as errors or at the very least as warnings by your compiler. But it's possible your compiler didn't get that far due to it's inability to resolve previous spaghetti template syntax.
GeneralRe: How to retrieve the user defined data type into main function Pin
Manoj73901-Jul-13 18:42
Manoj73901-Jul-13 18:42 
GeneralRe: How to retrieve the user defined data type into main function Pin
Stefan_Lang2-Jul-13 0:22
Stefan_Lang2-Jul-13 0:22 
GeneralRe: How to retrieve the user defined data type into main function Pin
Manoj73902-Jul-13 23:47
Manoj73902-Jul-13 23:47 
GeneralRe: How to retrieve the user defined data type into main function Pin
Stefan_Lang3-Jul-13 0:28
Stefan_Lang3-Jul-13 0:28 
GeneralRe: How to retrieve the user defined data type into main function Pin
Stefan_Lang3-Jul-13 0:36
Stefan_Lang3-Jul-13 0:36 
GeneralRe: How to retrieve the user defined data type into main function Pin
Manoj73903-Jul-13 20:53
Manoj73903-Jul-13 20:53 
GeneralRe: How to retrieve the user defined data type into main function Pin
Stefan_Lang4-Jul-13 1:54
Stefan_Lang4-Jul-13 1:54 
Questionhow to start Pin
john563219-Jun-13 19:04
john563219-Jun-13 19:04 
AnswerRe: how to start Pin
thanh_bkhn19-Jun-13 20:18
professionalthanh_bkhn19-Jun-13 20:18 
AnswerRe: how to start Pin
Richard MacCutchan19-Jun-13 20:29
mveRichard MacCutchan19-Jun-13 20:29 
AnswerRe: how to start Pin
_AnsHUMAN_ 20-Jun-13 23:04
_AnsHUMAN_ 20-Jun-13 23:04 
Questionfatal error C1083: Cannot open source file: ' ..\filea.cpp Pin
ForNow19-Jun-13 5:53
ForNow19-Jun-13 5:53 
QuestionRe: fatal error C1083: Cannot open source file: ' ..\filea.cpp Pin
David Crow19-Jun-13 6:10
David Crow19-Jun-13 6:10 
AnswerRe: fatal error C1083: Cannot open source file: ' ..\filea.cpp Pin
ForNow19-Jun-13 6:19
ForNow19-Jun-13 6:19 
GeneralRe: fatal error C1083: Cannot open source file: ' ..\filea.cpp Pin
Richard MacCutchan19-Jun-13 6:56
mveRichard MacCutchan19-Jun-13 6:56 
SuggestionRe: fatal error C1083: Cannot open source file: ' ..\filea.cpp Pin
David Crow19-Jun-13 7:40
David Crow19-Jun-13 7:40 
QuestionHow to Implement HD video recording using DirectShow.? Pin
mbatra3119-Jun-13 3:34
mbatra3119-Jun-13 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.