Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: scanner Driver Pin
NitinMakwana8-Jan-10 1:10
NitinMakwana8-Jan-10 1:10 
QuestionMemory Leak Pin
BarryPearlman23-Oct-09 10:51
BarryPearlman23-Oct-09 10:51 
AnswerRe: Memory Leak Pin
«_Superman_»23-Oct-09 12:21
professional«_Superman_»23-Oct-09 12:21 
AnswerRe: Memory Leak Pin
BarryPearlman25-Oct-09 3:56
BarryPearlman25-Oct-09 3:56 
GeneralRe: Memory Leak Pin
«_Superman_»25-Oct-09 8:43
professional«_Superman_»25-Oct-09 8:43 
AnswerRe: Memory Leak Pin
PJ Arends23-Oct-09 12:37
professionalPJ Arends23-Oct-09 12:37 
GeneralRe: Memory Leak Pin
BarryPearlman23-Oct-09 15:12
BarryPearlman23-Oct-09 15:12 
Questionint treated as binary no. Pin
Manmohan2923-Oct-09 10:41
Manmohan2923-Oct-09 10:41 
void CaDlg::OnBnClickedBrefreshdevices()
{
	// TODO: Add your control notification handler code here	
	m_ctlStatus.SetString(_T("Not Functional"));
	UpdateData(FALSE);
	unsigned int field0 = 0, field1 = 0, field2 = 0, field3 = 0;
	CString ips = _T("");
	char a[4] = "";
	int t=0,c=0;

	for(field0 = 192; field0 <= 192; field0++)
	{
		for(field1 = 168; field1 <= 168; field1++)
		{
			for(field2 = 0; field2 <= 255; field2++)
			{
				for(field3 = 0; field3 <= 255; field3++)
				{
					
					_itoa_s(field0, a, 4, 10);
					ips += a;
					ips += '.';
					_itoa_s(field1, a, 4, 10);
					ips += a;
					ips += '.';
					_itoa_s(field2, a, 4, 10);
					ips += a;
					ips += '.';
					_itoa_s(field3, a, 4, 10);
					ips += a;
					t = LCDevices.InsertItem(c, ips);
					c++;                   // some counter variable

					LCDevices.SetItemText(c, 1, _T("Testing"));
					ips = _T("");          //Reset sting variable

				}
			}
		}
	}

}


In this code I am getting a bug when the value of t reaches 9. When InsertItem(c, ips); increases the
value to 10 (ten) it becomes 2 (i.e. 10 is treated as binary nos. 1 0).
Why is it so?
the integer c is not treated as binary no.

Future Lies in Present.
Manmohan Bishnoi

AnswerRe: int treated as binary no. Pin
David Crow23-Oct-09 10:45
David Crow23-Oct-09 10:45 
GeneralRe: int treated as binary no. Pin
Manmohan2923-Oct-09 10:58
Manmohan2923-Oct-09 10:58 
AnswerRe: int treated as binary no. Pin
David Crow23-Oct-09 11:04
David Crow23-Oct-09 11:04 
GeneralRe: int treated as binary no. Pin
Manmohan2923-Oct-09 11:16
Manmohan2923-Oct-09 11:16 
GeneralRe: int treated as binary no. Pin
David Crow23-Oct-09 15:08
David Crow23-Oct-09 15:08 
QuestionScrollbars are shown incorrectly. Pin
Nikz223-Oct-09 10:01
Nikz223-Oct-09 10:01 
AnswerRe: Scrollbars are shown incorrectly. [modified] Pin
Nikz223-Oct-09 12:17
Nikz223-Oct-09 12:17 
GeneralRe: Scrollbars are shown incorrectly. Pin
«_Superman_»23-Oct-09 12:31
professional«_Superman_»23-Oct-09 12:31 
GeneralRe: Scrollbars are shown incorrectly. Pin
Nikz223-Oct-09 12:53
Nikz223-Oct-09 12:53 
GeneralRe: Scrollbars are shown incorrectly. Pin
«_Superman_»23-Oct-09 13:01
professional«_Superman_»23-Oct-09 13:01 
GeneralSolution Pin
Nikz223-Oct-09 14:07
Nikz223-Oct-09 14:07 
GeneralRe: Scrollbars are shown incorrectly. Pin
«_Superman_»23-Oct-09 14:15
professional«_Superman_»23-Oct-09 14:15 
QuestionLooking for Mathematical Expressions Evaluator Pin
Tony Teveris23-Oct-09 9:25
Tony Teveris23-Oct-09 9:25 
AnswerRe: Looking for Mathematical Expressions Evaluator Pin
David Crow23-Oct-09 9:33
David Crow23-Oct-09 9:33 
QuestionWho has the file opened? Pin
Peter Weyzen23-Oct-09 9:11
Peter Weyzen23-Oct-09 9:11 
QuestionRe: Who has the file opened? Pin
David Crow23-Oct-09 9:34
David Crow23-Oct-09 9:34 
AnswerRe: Who has the file opened? Pin
Peter Weyzen23-Oct-09 10:19
Peter Weyzen23-Oct-09 10:19 

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.