Click here to Skip to main content
15,920,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can I group function (method) within Struct in ANSI C? Pin
Michael Dunn18-Sep-04 19:16
sitebuilderMichael Dunn18-Sep-04 19:16 
GeneralRe: Can I group function (method) within Struct in ANSI C? Pin
Link260018-Sep-04 19:23
Link260018-Sep-04 19:23 
AnswerRe: Can I group function (method) within Struct in ANSI C? Pin
cmk18-Sep-04 21:00
cmk18-Sep-04 21:00 
GeneralRe: Can I group function (method) within Struct in ANSI C? Pin
Anonymous18-Sep-04 18:10
Anonymous18-Sep-04 18:10 
Generalstatic constant template member problems Pin
Andras Zoltan18-Sep-04 12:17
Andras Zoltan18-Sep-04 12:17 
GeneralRe: static constant template member problems Pin
Michael Dunn18-Sep-04 12:56
sitebuilderMichael Dunn18-Sep-04 12:56 
GeneralRe: static constant template member problems Pin
Andras Zoltan19-Sep-04 3:08
Andras Zoltan19-Sep-04 3:08 
GeneralRe: static constant template member problems Pin
Michael Dunn19-Sep-04 11:50
sitebuilderMichael Dunn19-Sep-04 11:50 
Unfortunately, I'm not seeing the problem you are. Here's the code I tested on VC 7.1:
#include <iostream>
#include <tchar.h>
using namespace std;
 
template <class T, int I> class X
{
public:
    X() {}
    static const icopy = I;
    static const iminus1 = I-1;
    static const itimes8 = I<<3;
 
    int array[I];
};
 
int _tmain(int argc, _TCHAR* argv[])
{
X<int, sizeof(int)> x1;
 
    cout << "x1.icopy = " << x1.icopy
         << "\nx1.iminus1 = " << x1.iminus1
         << "\nx1.itimes8 = " << x1.itimes8 << '\n';
 
	return 0;
}
Output:
x1.icopy = 4
x1.iminus1 = 3
x1.itimes8 = 32


--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ

----
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?

GeneralRe: static constant template member problems Pin
Andras Zoltan20-Sep-04 12:25
Andras Zoltan20-Sep-04 12:25 
GeneralRe: static constant template member problems Pin
Michael Dunn20-Sep-04 12:36
sitebuilderMichael Dunn20-Sep-04 12:36 
Questionhow to remove MDI doc template Pin
Igemon18-Sep-04 11:22
Igemon18-Sep-04 11:22 
GeneralDLL debug error message.. Pin
Laing,James18-Sep-04 10:38
Laing,James18-Sep-04 10:38 
GeneralRe: DLL debug error message.. Pin
Tim Smith18-Sep-04 19:17
Tim Smith18-Sep-04 19:17 
GeneralRe: DLL debug error message.. Pin
cmk18-Sep-04 21:17
cmk18-Sep-04 21:17 
QuestionDialog to Tray? Pin
Larsson18-Sep-04 9:44
Larsson18-Sep-04 9:44 
Generaldisplaying the cursor Pin
Member 117092518-Sep-04 9:29
Member 117092518-Sep-04 9:29 
GeneralAdvice needed for a DB project. Pin
crimsongrape18-Sep-04 8:48
crimsongrape18-Sep-04 8:48 
GeneralRe: Advice needed for a DB project. Pin
cmk18-Sep-04 21:25
cmk18-Sep-04 21:25 
GeneralON_CHANGE of CRicheditCtrl works abnormality in windows 98 Pin
Anonymous18-Sep-04 5:57
Anonymous18-Sep-04 5:57 
GeneralTake answer from a user then go to certain string Pin
intilli18-Sep-04 4:43
intilli18-Sep-04 4:43 
QuestionDialog q? Pin
Larsson18-Sep-04 3:29
Larsson18-Sep-04 3:29 
AnswerRe: Dialog q? Pin
Ravi Bhavnani18-Sep-04 7:19
professionalRavi Bhavnani18-Sep-04 7:19 
GeneralRe: Dialog q? Pin
User 665818-Sep-04 7:34
User 665818-Sep-04 7:34 
GeneralRe: Dialog q? Pin
Larsson18-Sep-04 7:50
Larsson18-Sep-04 7:50 
GeneralSmart Card SDK Pin
jsaroj17-Sep-04 20:56
jsaroj17-Sep-04 20:56 

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.