Click here to Skip to main content
15,891,902 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SendMessage Pin
Roger Stoltz4-Apr-07 1:08
Roger Stoltz4-Apr-07 1:08 
GeneralRe: SendMessage Pin
Anilkumar K V9-Apr-07 23:14
Anilkumar K V9-Apr-07 23:14 
GeneralRe: SendMessage Pin
Roger Stoltz10-Apr-07 1:29
Roger Stoltz10-Apr-07 1:29 
GeneralRe: SendMessage Pin
Anilkumar K V11-Apr-07 19:53
Anilkumar K V11-Apr-07 19:53 
QuestionTab controls Pin
deeps_cute3-Apr-07 20:04
deeps_cute3-Apr-07 20:04 
AnswerRe: Tab controls Pin
vimarsh puneet3-Apr-07 20:31
vimarsh puneet3-Apr-07 20:31 
AnswerRe: Tab controls Pin
Cedric Moonen3-Apr-07 20:56
Cedric Moonen3-Apr-07 20:56 
QuestionMake virtual method in my project Pin
nhatvhm3-Apr-07 18:34
nhatvhm3-Apr-07 18:34 
//*****************************Main Program ******************************
#include <stdio.h><br />
#include <conio.h><br />
#include <stdlib.h><br />
#include "ReadWrite.h"<br />
#include "Graph.h"<br />
<br />
<br />
void main(int doiso, char *thamso[])<br />
{<br />
	<br />
	GRAPH G;<br />
	int rf=G.ReadData(thamso[1]);<br />
	if(!rf)<br />
		printf("Khong doc duoc file!\n");<br />
	else<br />
	{<br />
		printf("Doc duoc file!\n");<br />
		G.GraphAlgorithm();<br />
		int wf=G.WriteData(thamso[2]);<br />
		if(wf)<br />
			printf("Ghi file thanh cong!");<br />
	}<br />
<br />
	getch();<br />
}<br />


//******************************Graph.cpp*********************************
#include <stdio.h><br />
#include <conio.h><br />
#include "Graph.h"<br />
<br />
int GRAPH::ReadData(char *FileName)<br />
{<br />
	FILE *fp=fopen(FileName,"rt");<br />
	if(!fp)<br />
		return 0;<br />
	fscanf(fp,"%d",&n);<br />
	B=new unsigned char *[n];<br />
	unsigned char *temp=new unsigned char [n];<br />
	for(int d=0; d<n; d++, temp+=d)<br />
		B[d]=temp;<br />
	for(int i=0; i<n; i++)<br />
		for(int j=0; j<n; j++)<br />
			fscanf(fp,"%d",&B[i][j]);<br />
	fclose(fp);<br />
	return 1;<br />
}<br />
<br />
const int GRAPH::WriteData(char *FileName)<br />
{<br />
	FILE *fp=fopen(FileName,"wt");<br />
	if(!fp)<br />
		return 0;<br />
	fprintf(fp,"%d",n);<br />
	for(int i=0; i<n; i++)<br />
	{<br />
		fprintf(fp,"\n");<br />
		for(int j=0; j<n; j++)<br />
			fprintf(fp,"%d\t",B[i][j]);<br />
	}<br />
	<br />
	//Hien thi thong tin thuat toan tim cac thanh phan lien thong<br />
	int nLT=label;<br />
	if(nLT==1)<br />
		fprintf(fp,"\nDo thi lien thong!");<br />
	else<br />
	{<br />
		fprintf(fp,"\nDo thi khong lien thong");<br />
		fprintf(fp,"\nCo %d thanh phan lien thong:",nLT);<br />
		for(int m=1; m<=label; m++)<br />
		{<br />
			fprintf(fp,"\nMien %d: ",m);<br />
			for(int i=0; i<n; i++)<br />
				if(LabelLT[i]==m)<br />
					fprintf(fp,"%4d",i);<br />
		}<br />
	}<br />
	fclose(fp);<br />
	return 1;<br />
}<br />
<br />
void GRAPH::GraphAlgorithm()<br />
{<br />
	//~Step 1:<br />
	label=0;<br />
	LabelLT = new int[n];<br />
	for(int i=0; i<n; i++)<br />
		LabelLT[i]=0;<br />
	//~Step 2:<br />
	for(i=0; i<n; i++)<br />
		if(LabelLT[i]==0)<br />
		{<br />
			label++;<br />
			Visit(i);<br />
		}<br />
}<br />
<br />
void GRAPH::Visit(int i)<br />
{<br />
	LabelLT[i]=label;<br />
	for(int j=0; j<n; j++)<br />
		if(B[i][j]==1||B[j][i]==1)<br />
			if(LabelLT[j]==0)<br />
				Visit(j);<br />
}<br />


//***********************Graph.h**************************************
class GRAPH<br />
{<br />
	private:<br />
		int n;<br />
		int label;<br />
		int *LabelLT;<br />
		unsigned char **B;<br />
	public:<br />
		int ReadData(char *FileName);<br />
		const int WriteData(char *FileName);<br />
		void GraphAlgorithm();<br />
		void Visit(int i);<br />
<br />
};


Help me, make virtual method in my project!

<(-|-)> "To be or not to be"
GeneralRe: Make virtual method in my project Pin
prasad_som3-Apr-07 18:48
prasad_som3-Apr-07 18:48 
AnswerRe: Make virtual method in my project Pin
ThatsAlok18-Apr-07 21:08
ThatsAlok18-Apr-07 21:08 
QuestionHow to use form view in tab control Pin
sireesha_sree3-Apr-07 18:29
sireesha_sree3-Apr-07 18:29 
AnswerRe: How to use form view in tab control Pin
Naveen3-Apr-07 19:14
Naveen3-Apr-07 19:14 
GeneralRe: How to use form view in tab control Pin
sireesha_sree3-Apr-07 19:22
sireesha_sree3-Apr-07 19:22 
QuestionRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 19:26
vimarsh puneet3-Apr-07 19:26 
AnswerRe: How to use form view in tab control Pin
sireesha_sree3-Apr-07 19:49
sireesha_sree3-Apr-07 19:49 
GeneralRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 20:02
vimarsh puneet3-Apr-07 20:02 
GeneralRe: How to use form view in tab control Pin
Naveen3-Apr-07 19:47
Naveen3-Apr-07 19:47 
GeneralRe: How to use form view in tab control Pin
megha_gharote3-Apr-07 19:52
megha_gharote3-Apr-07 19:52 
GeneralRe: How to use form view in tab control Pin
Naveen3-Apr-07 19:58
Naveen3-Apr-07 19:58 
GeneralRe: How to use form view in tab control Pin
sireesha_sree3-Apr-07 20:02
sireesha_sree3-Apr-07 20:02 
GeneralRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 20:08
vimarsh puneet3-Apr-07 20:08 
GeneralRe: How to use form view in tab control Pin
megha_gharote3-Apr-07 20:11
megha_gharote3-Apr-07 20:11 
AnswerRe: How to use form view in tab control Pin
vimarsh puneet3-Apr-07 20:29
vimarsh puneet3-Apr-07 20:29 
GeneralRe: How to use form view in tab control Pin
Naveen3-Apr-07 20:31
Naveen3-Apr-07 20:31 
GeneralRe: How to use form view in tab control Pin
Naveen3-Apr-07 20:11
Naveen3-Apr-07 20:11 

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.