Click here to Skip to main content
15,908,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: structure to file Pin
goldenrose917-Feb-11 5:30
goldenrose917-Feb-11 5:30 
GeneralRe: structure to file Pin
David Crow17-Feb-11 7:13
David Crow17-Feb-11 7:13 
GeneralRe: structure to file Pin
goldenrose917-Feb-11 7:17
goldenrose917-Feb-11 7:17 
AnswerRe: structure to file Pin
Alain Rist16-Feb-11 11:41
Alain Rist16-Feb-11 11:41 
GeneralRe: structure to file Pin
Richard MacCutchan16-Feb-11 21:28
mveRichard MacCutchan16-Feb-11 21:28 
AnswerRe: structure to file Pin
jk chan16-Feb-11 6:22
jk chan16-Feb-11 6:22 
GeneralRe: structure to file Pin
goldenrose916-Feb-11 7:04
goldenrose916-Feb-11 7:04 
QuestionReturn data when using SendMessage Pin
manchukuo16-Feb-11 5:56
manchukuo16-Feb-11 5:56 
AnswerRe: Return data when using SendMessage Pin
Richard MacCutchan16-Feb-11 6:19
mveRichard MacCutchan16-Feb-11 6:19 
GeneralRe: Return data when using SendMessage Pin
manchukuo16-Feb-11 6:22
manchukuo16-Feb-11 6:22 
GeneralRe: Return data when using SendMessage Pin
Richard MacCutchan16-Feb-11 21:26
mveRichard MacCutchan16-Feb-11 21:26 
QuestionsetDllDirectory in x64 project Pin
zon_cpp16-Feb-11 2:16
zon_cpp16-Feb-11 2:16 
AnswerRe: setDllDirectory in x64 project Pin
Richard MacCutchan16-Feb-11 2:39
mveRichard MacCutchan16-Feb-11 2:39 
QuestionAccessing web service in native C++ application Pin
vipin_nvk16-Feb-11 0:11
vipin_nvk16-Feb-11 0:11 
AnswerRe: Accessing web service in native C++ application Pin
ShilpiP16-Feb-11 0:31
ShilpiP16-Feb-11 0:31 
QuestionSame Resource IDs in resource.h Pin
Anu_Bala15-Feb-11 20:07
Anu_Bala15-Feb-11 20:07 
AnswerRe: Same Resource IDs in resource.h Pin
Hans Dietrich15-Feb-11 21:10
mentorHans Dietrich15-Feb-11 21:10 
AnswerRe: Same Resource IDs in resource.h Pin
ThatsAlok15-Feb-11 21:12
ThatsAlok15-Feb-11 21:12 
GeneralRe: Same Resource IDs in resource.h Pin
Anu_Bala15-Feb-11 21:46
Anu_Bala15-Feb-11 21:46 
AnswerRe: Same Resource IDs in resource.h Pin
chevu15-Feb-11 22:01
chevu15-Feb-11 22:01 
GeneralRe: Same Resource IDs in resource.h Pin
ThatsAlok15-Feb-11 22:52
ThatsAlok15-Feb-11 22:52 
GeneralRe: Same Resource IDs in resource.h Pin
Anu_Bala15-Feb-11 22:54
Anu_Bala15-Feb-11 22:54 
QuestionArray Issue. Pin
Mike Certini15-Feb-11 19:13
Mike Certini15-Feb-11 19:13 
I put together a program that takes a list of numbers in an array and sorts them by copying out of the first array into a second array when the value in the first array matches the maximum array element in the first array. What I cannot figure out is why when I look at the array elements saved in the final array there is a skip in element #10 to #11. In other words the second array correctly saves nine 10's and then skips element #10 and then saves the 9's starting in element #11.

#include <stdio.h>
#include <stdlib.h>
#define LIMIT 100

int roll[100];
int fin[100];
int num = 0;


int main(void)
	{
	int cyc = 0;
	int top = 0;
	int rotate = 0;
	int seek = 0;
	int loop = 0;
	int temp = 0;
		
	while(num < LIMIT)
		{
		roll[num] = rand() % 10 + 1;
		printf("%i",roll[num]);
		printf("\n");
		num++;
		}
	
	for(cyc = 0; cyc < num; cyc++)
		{
		if(roll[loop] > roll[loop+1] && roll[loop] > temp)
			{
			temp = roll[loop];
			}
		loop++;
		}
	
	for(cyc = 0; cyc < num; cyc++)
		{
		loop = 0;			        //Zero loop for second number to be evaluated
		while(loop < num)	                //Go through entire list
			{
			if(roll[loop] == temp)	        //Evaluate whether item matches maximum number
				{																			
				fin[cyc] = roll[loop];	//Copy item in the first array into the final array.
				cyc++;			//Increment cycle by 1.
				}
			loop++;				//Increment loop to pass through entire list.
			}
		temp--;					//Decrement number to be evaluated.	
		}
	}

AnswerSolution To Array Issue. Pin
Mike Certini15-Feb-11 20:07
Mike Certini15-Feb-11 20:07 
AnswerRe: Array Issue. Pin
User 742933815-Feb-11 20:07
professionalUser 742933815-Feb-11 20:07 

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.