Click here to Skip to main content
15,911,132 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Change the struct definition to
C++
template<int P> struct encrypt_data_t {
   typename Cryptography::EllipticCurve<P>::Point Pa;
   FiniteFieldElement<P> c1;
   FiniteFieldElement<P> c2;
} ;

Then call this function like this:
C++
int main(...) {
   const int MY_P = 263;
   ...
   encrypt_data_t<MY_P> result = my_encrypt<MY_P>();
   ...
}

Of course, you also have to fix your function code - the code you posted does not declare half the variables it uses.

Or you could just skip that structure and instead pass these values back by reference[^]:
C++
template <int P>
void my_encrypt(typename Cryptography::EllipticCurve<P>::Point& Pa,
                FiniteFieldElement<P>& c1, FiniteFieldElement<P>& c2) {
 ...
}
int main(...) {
   const int MY_P = 263;
   typename Cryptography::EllipticCurve<MY_P>::Point Pa;
   FiniteFieldElement<MY_P> c1;
   FiniteFieldElement<MY_P> c2;
   my_encrypt(Pa, c1, c2);
}

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 
QuestionHow to download a httpfile throw Proxy Pin
haha_c18-Jun-13 17:19
haha_c18-Jun-13 17:19 
SuggestionRe: How to download a httpfile throw Proxy Pin
Richard MacCutchan18-Jun-13 22:55
mveRichard MacCutchan18-Jun-13 22:55 
QuestionMemory, speed and MSXML Pin
Argonia18-Jun-13 5:32
professionalArgonia18-Jun-13 5:32 
QuestionRe: Memory, speed and MSXML Pin
David Crow18-Jun-13 6:13
David Crow18-Jun-13 6:13 
AnswerRe: Memory, speed and MSXML Pin
Argonia18-Jun-13 7:52
professionalArgonia18-Jun-13 7:52 
GeneralRe: Memory, speed and MSXML Pin
David Crow18-Jun-13 9:55
David Crow18-Jun-13 9:55 
QuestionDoes ActiveX ctrl work as seperate process? Pin
Vaibhav Gupt18-Jun-13 0:41
Vaibhav Gupt18-Jun-13 0:41 

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.