Click here to Skip to main content
15,915,089 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: how to truncate a string based on buffer size. Pin
CPallini23-Jul-08 6:55
mveCPallini23-Jul-08 6:55 
AnswerRe: how to truncate a string based on buffer size. Pin
Nandu_77b23-Jul-08 7:05
Nandu_77b23-Jul-08 7:05 
QuestionRe: how to truncate a string based on buffer size. Pin
Nandu_77b23-Jul-08 7:06
Nandu_77b23-Jul-08 7:06 
QuestionRe: how to truncate a string based on buffer size. Pin
CPallini23-Jul-08 7:20
mveCPallini23-Jul-08 7:20 
AnswerRe: how to truncate a string based on buffer size. Pin
Nandu_77b23-Jul-08 10:09
Nandu_77b23-Jul-08 10:09 
AnswerRe: how to truncate a string based on buffer size. Pin
Joe Woodbury23-Jul-08 12:55
professionalJoe Woodbury23-Jul-08 12:55 
QuestionToolBar Switching Pin
Nuri Ismail23-Jul-08 5:56
Nuri Ismail23-Jul-08 5:56 
QuestionStatic variable Pin
AnithaSubramani23-Jul-08 4:52
AnithaSubramani23-Jul-08 4:52 
Dear All,

I have two classes Test and Test1. I have a static variable in the class Test and I have to access it in another class Test1 from a funtion. When I access it, I got linker error. The error is :
1>Test1.obj : error LNK2001: unresolved external symbol "public: static int Test::cnt" (?cnt@Test@@2HA)
1>Test.obj : error LNK2001: unresolved external symbol "public: static int Test::cnt" (?cnt@Test@@2HA)

Code snippet :
//First class
class Test : public CDialog,public CDemux
{
	DECLARE_DYNAMIC(DecodeTS)
	//DECLARE_DYNAMIC(TSAnalyzerDlg)
Public
	static int cnt;

.......

//Second class function
void Test1::GetData()
{
int cnt =Test::cnt;
}

AnswerRe: Static variable Pin
Alan Balkany23-Jul-08 5:02
Alan Balkany23-Jul-08 5:02 
GeneralRe: Static variable Pin
AnithaSubramani23-Jul-08 5:27
AnithaSubramani23-Jul-08 5:27 
GeneralRe: Static variable Pin
AnithaSubramani23-Jul-08 5:33
AnithaSubramani23-Jul-08 5:33 
GeneralRe: Static variable Pin
Mark Salsbery23-Jul-08 6:25
Mark Salsbery23-Jul-08 6:25 
GeneralRe: Static variable Pin
Alan Balkany23-Jul-08 7:38
Alan Balkany23-Jul-08 7:38 
GeneralRe: Static variable Pin
Mark Salsbery23-Jul-08 8:08
Mark Salsbery23-Jul-08 8:08 
GeneralRe: Static variable Pin
Alan Balkany23-Jul-08 8:11
Alan Balkany23-Jul-08 8:11 
GeneralRe: Static variable Pin
Mark Salsbery23-Jul-08 8:13
Mark Salsbery23-Jul-08 8:13 
GeneralRe: Static variable Pin
Alan Balkany23-Jul-08 8:18
Alan Balkany23-Jul-08 8:18 
GeneralRe: Static variable Pin
Mark Salsbery23-Jul-08 8:54
Mark Salsbery23-Jul-08 8:54 
GeneralRe: Static variable Pin
Alan Balkany23-Jul-08 9:00
Alan Balkany23-Jul-08 9:00 
GeneralRe: Static variable Pin
Mark Salsbery23-Jul-08 9:06
Mark Salsbery23-Jul-08 9:06 
QuestionRe: Static variable Pin
David Crow23-Jul-08 5:04
David Crow23-Jul-08 5:04 
AnswerRe: Static variable Pin
AnithaSubramani23-Jul-08 5:34
AnithaSubramani23-Jul-08 5:34 
AnswerRe: Static variable Pin
Mark Salsbery23-Jul-08 6:26
Mark Salsbery23-Jul-08 6:26 
GeneralRe: Static variable Pin
David Crow23-Jul-08 6:28
David Crow23-Jul-08 6:28 
Question64bit PKWare Compatible Compression Library Pin
Steve Thresher23-Jul-08 4:40
Steve Thresher23-Jul-08 4:40 

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.