Click here to Skip to main content
15,885,141 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionAdding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha23-Mar-18 21:17
Tarun Jha23-Mar-18 21:17 
AnswerRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Richard MacCutchan23-Mar-18 23:34
mveRichard MacCutchan23-Mar-18 23:34 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha24-Mar-18 3:58
Tarun Jha24-Mar-18 3:58 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Richard MacCutchan24-Mar-18 4:31
mveRichard MacCutchan24-Mar-18 4:31 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha24-Mar-18 8:17
Tarun Jha24-Mar-18 8:17 
QuestionWhy the arrow button on TabControl is not working in my MFC application. Pin
Sampath57910-Mar-18 0:35
Sampath57910-Mar-18 0:35 
AnswerRe: Why the arrow button on TabControl is not working in my MFC application. Pin
Richard MacCutchan10-Mar-18 1:07
mveRichard MacCutchan10-Mar-18 1:07 
QuestionHow to change color of Tab View in MFC Pin
Sampath57910-Mar-18 0:01
Sampath57910-Mar-18 0:01 
AnswerRe: How to change color of Tab View in MFC Pin
Richard MacCutchan10-Mar-18 1:07
mveRichard MacCutchan10-Mar-18 1:07 
Questionhow to use getchar() to store n names in an array ? Pin
Tarun Jha26-Dec-17 8:31
Tarun Jha26-Dec-17 8:31 
AnswerRe: how to use getchar() to store n names in an array ? Pin
Richard MacCutchan26-Dec-17 8:46
mveRichard MacCutchan26-Dec-17 8:46 
AnswerRe: how to use getchar() to store n names in an array ? Pin
Rick York26-Dec-17 10:04
mveRick York26-Dec-17 10:04 
GeneralRe: how to use getchar() to store n names in an array ? Pin
Tarun Jha26-Dec-17 20:02
Tarun Jha26-Dec-17 20:02 
Questionhow to initialize a value to pointer ? Pin
Tarun Jha21-Dec-17 9:08
Tarun Jha21-Dec-17 9:08 
AnswerRe: how to initialize a value to pointer ? Pin
Rick York21-Dec-17 9:45
mveRick York21-Dec-17 9:45 
GeneralRe: how to initialize a value to pointer ? Pin
Tarun Jha21-Dec-17 10:20
Tarun Jha21-Dec-17 10:20 
GeneralRe: how to initialize a value to pointer ? Pin
Rick York21-Dec-17 12:25
mveRick York21-Dec-17 12:25 
You are very close. The problem now is your for loops are exceeding the capacity of num. It has 10 elements and your loops go from 0 to 10 inclusively. That is 11 elements - there is no num[11] item so that is a very bad thing.

I don't like literal values so I made the number a const and adjusted the loops :
const int Count = 10;

void main()
{
	int i;
	int num[Count];
	int *p;

	p = &num[0];
	
	for( i=0; i < Count; i++ )
	{
		*(p+i) = i;
	}
	
	for( i=0; i < Count; i++ )
	{
		trace( _T( "item %d is %d" ), i, *(p+i) );
	}
	return 0;
}
Your code looks quite a bit like C but this is a section for ATL/WTL/STL is about C++. If you are actually using C then this code won't compile. You can make Count a macro definition and then it will.
GeneralRe: how to initialize a value to pointer ? Pin
Tarun Jha26-Dec-17 8:13
Tarun Jha26-Dec-17 8:13 
AnswerRe: how to initialize a value to pointer ? Pin
Richard MacCutchan21-Dec-17 21:42
mveRichard MacCutchan21-Dec-17 21:42 
QuestionProblem with recursion. Pin
Tarun Jha16-Dec-17 5:46
Tarun Jha16-Dec-17 5:46 
QuestionRe: Recursion not working. Pin
Richard MacCutchan16-Dec-17 6:24
mveRichard MacCutchan16-Dec-17 6:24 
AnswerRe: Recursion not working. Pin
Tarun Jha16-Dec-17 7:51
Tarun Jha16-Dec-17 7:51 
GeneralRe: Recursion not working. Pin
Richard MacCutchan16-Dec-17 9:49
mveRichard MacCutchan16-Dec-17 9:49 
GeneralRe: Recursion not working. Pin
Rick York21-Dec-17 9:49
mveRick York21-Dec-17 9:49 
QuestionTo take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 4:55
Tarun Jha10-Dec-17 4:55 

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.