Click here to Skip to main content
14,662,597 members
Home » Discussions » ATL / WTL / STL
   

ATL / WTL / STL

 
Questionhow to initialize a value to pointer ? Pin
Tarun Jha21-Dec-17 9:08
MemberTarun 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
MemberTarun Jha21-Dec-17 10:20 
if p = address of the num[0] then (p+i) is the address of the ith address and it is where i want to store the value, *(p+i) will give the value at that address i.e. de-referencing, below is the code i tried.
<pre>#include <stdio.h>

int main()
{
	int i, num[10];
	int *p;
	p = &num[0];
	
	for(i=0; i<=10; i++)
	{
		*(p+i) = i;
	}
	
	for(i=0; i<=10; i++)
	{
		printf("\n%d", *(p+i));
	}
	
	
	return 0;
}


GeneralRe: how to initialize a value to pointer ? Pin
Rick York21-Dec-17 12:25
mveRick York21-Dec-17 12:25 
GeneralRe: how to initialize a value to pointer ? Pin
Tarun Jha26-Dec-17 8:13
MemberTarun 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
MemberTarun 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
MemberTarun 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
MemberTarun Jha10-Dec-17 4:55 
AnswerRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 5:49
mveRichard MacCutchan10-Dec-17 5:49 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 6:11
MemberTarun Jha10-Dec-17 6:11 
GeneralRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 6:18
mveRichard MacCutchan10-Dec-17 6:18 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 6:48
MemberTarun Jha10-Dec-17 6:48 
GeneralRe: To take input for n number of arrays and print it. Pin
Richard MacCutchan10-Dec-17 6:52
mveRichard MacCutchan10-Dec-17 6:52 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha10-Dec-17 7:19
MemberTarun Jha10-Dec-17 7:19 
AnswerRe: To take input for n number of arrays and print it. Pin
Member 1332249811-Dec-17 8:55
MemberMember 1332249811-Dec-17 8:55 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha11-Dec-17 10:56
MemberTarun Jha11-Dec-17 10:56 
GeneralRe: To take input for n number of arrays and print it. Pin
Tarun Jha16-Dec-17 5:41
MemberTarun Jha16-Dec-17 5:41 
QuestionHow do I keyboard input in OpenGL Pin
Mr. Anup Roy1-Dec-17 3:57
professionalMr. Anup Roy1-Dec-17 3:57 
QuestionHow to get cpu speed and ram manufaturer C Languae? Pin
Uzair Ahmad12-Nov-17 4:56
MemberUzair Ahmad12-Nov-17 4:56 
AnswerRe: How to get cpu speed and ram manufaturer C Languae? Pin
Afzaal Ahmad Zeeshan1-Dec-17 4:32
mvaAfzaal Ahmad Zeeshan1-Dec-17 4:32 
QuestionHow to Disable open drop down Pin
yaswanthdasari24-Oct-17 21:36
Memberyaswanthdasari24-Oct-17 21:36 

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.