Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generali have been Written a Hanoi's tower that base on GUI using VC++ development. Pin
starschen27-Apr-05 19:12
sussstarschen27-Apr-05 19:12 
GeneralAfxBeginThread Pin
Member 6562827-Apr-05 18:59
Member 6562827-Apr-05 18:59 
GeneralRe: AfxBeginThread Pin
PJ Arends28-Apr-05 11:02
professionalPJ Arends28-Apr-05 11:02 
GeneralRe: AfxBeginThread Pin
Member 6562829-Apr-05 3:49
Member 6562829-Apr-05 3:49 
GeneralRe: AfxBeginThread Pin
PJ Arends29-Apr-05 6:20
professionalPJ Arends29-Apr-05 6:20 
QuestionHow do i disable mouse wheel in comboBox (MFC) Pin
Yanshof27-Apr-05 18:11
Yanshof27-Apr-05 18:11 
AnswerRe: How do i disable mouse wheel in comboBox (MFC) Pin
Rage27-Apr-05 22:31
professionalRage27-Apr-05 22:31 
General2d arrays Pin
aaadetos27-Apr-05 17:54
aaadetos27-Apr-05 17:54 
I can't figure out why the arrays dip_array,azim_array aren't yielding the proper values:
<br />
// Q2_new.cpp : Defines the entry point for the console application.<br />
//<br />
<br />
#include <math><br />
#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
double theta, phi, t, p;	//azimuth and dip angles respectively<br />
double lambda1 = 0.5;<br />
double lambda2 = 2;<br />
double a11,a12,a21,a22,d11,d13,d31,d33;<br />
const double pi = 3.142857;<br />
const int rows = 3;<br />
const int cols = 3;<br />
<br />
//---------------------------------------------------------<br />
//Code to convert the angles to radians, acceptable in C++<br />
//---------------------------------------------------------<br />
//Dip Angle,p<br />
double a(double p)<br />
{<br />
	d11 = cos((p*pi)/180);<br />
	return d11;<br />
}<br />
<br />
double b(double p)<br />
{<br />
	d13 = -1*sin((p*pi)/180);<br />
	return d13;<br />
}<br />
<br />
double c(double p)<br />
{<br />
	d31 = sin((p*pi)/180);<br />
	return d31;<br />
}<br />
<br />
double d(double p)<br />
{<br />
	d33 = cos((p*pi)/180);<br />
	return d33;<br />
}<br />
<br />
<br />
//Azimuth Angles, t<br />
double e(double t)<br />
{<br />
	a11 = sin((t*pi)/180);<br />
	return a11;<br />
}<br />
<br />
double f(double t)<br />
{<br />
	a12 = cos((t*pi)/180);<br />
	return a12;<br />
}<br />
<br />
double g(double t)<br />
{<br />
	a21 = -1*cos((t*pi)/180);<br />
	return a21;<br />
}<br />
<br />
double h(double t)<br />
{<br />
	a22 = sin((t*pi)/180);<br />
	return a22;<br />
}<br />
<br />
//-----------------------------------------------------------<br />
//Initializing the matrices<br />
//-----------------------------------------------------------<br />
//array that holds the dip angle, phi<br />
double dip_array [3][3] = {{a(p),0,d13},{0,1,0},{d31,0,d33}};	<br />
<br />
//array that holds the azimuth angle, theta<br />
double azim_array [3][3] = {{a11,a12,0},{a21,a22,0},{0,0,1}};	<br />
<br />
//array that holds the anisotropy ratios<br />
double lambda_array [3][3] = {{lambda1,0,0},{0,1,0},{0,0,lambda2}};	<br />
<br />
//array that holds the original range values<br />
double r_array [3][1] = {4,8,3.94};<br />
<br />
//----------------------------------------------------------------<br />
<br />
void printarray (double arg[][3]) <br />
{<br />
  for (int i=0; i<3; i++)//for each row<br />
  {<br />
	  for (int j=0; j<3; j++)	//for each column value<br />
		  cout << arg[i][j] << " ";<br />
	  cout << "\n";<br />
  }<br />
}<br />
<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
	<br />
	cout<<"ANISOTROPY MODELLING.\n";<br />
	cout<<"Please enter a real number between 0 and 360 for the azimuth angle, theta, then press the 'Enter' key.\n\n";<br />
	cin>>t;<br />
<br />
	cout<<"Please enter a real number between 0 and 360 for the dip angle, phi, then press the 'Enter' key.\n\n";<br />
	cin>>p;<br />
<br />
	a(p);<br />
	b(p);<br />
	c(p);<br />
	d(p);<br />
	e(t);<br />
	f(t);<br />
	g(t);<br />
	h(t);<br />
<br />
	printarray(dip_array);"\n.";<br />
	printarray(azim_array);<br />
	printarray(lambda_array);<br />
<br />
	return 0;<br />
}<br />
<br />
Please help
GeneralRe: 2d arrays Pin
Paul M Watt27-Apr-05 18:45
mentorPaul M Watt27-Apr-05 18:45 
GeneralRe: 2d arrays Pin
Anonymous28-Apr-05 4:35
Anonymous28-Apr-05 4:35 
GeneralRe: 2d arrays Pin
aaadetos28-Apr-05 7:52
aaadetos28-Apr-05 7:52 
QuestionWin32 Console Application project ? Pin
Anonymous27-Apr-05 17:36
Anonymous27-Apr-05 17:36 
AnswerRe: Win32 Console Application project ? Pin
Yanshof27-Apr-05 18:24
Yanshof27-Apr-05 18:24 
GeneralRe: Win32 Console Application project ? Pin
Anonymous28-Apr-05 0:11
Anonymous28-Apr-05 0:11 
GeneralRe: Win32 Console Application project ? Pin
Anonymous28-Apr-05 0:15
Anonymous28-Apr-05 0:15 
GeneralRe: Win32 Console Application project ? Pin
ThatsAlok28-Apr-05 1:08
ThatsAlok28-Apr-05 1:08 
Questionwindow hook uninstalled? Pin
outoolcoe27-Apr-05 17:27
outoolcoe27-Apr-05 17:27 
GeneralNeed Your Help!!!! Pin
Jack.Fu27-Apr-05 16:31
Jack.Fu27-Apr-05 16:31 
GeneralRe: Need Your Help!!!! Pin
mkuhac27-Apr-05 17:17
mkuhac27-Apr-05 17:17 
GeneralRe: Need Your Help!!!! Pin
Jack.Fu27-Apr-05 17:36
Jack.Fu27-Apr-05 17:36 
GeneralRe: Need Your Help!!!! Pin
Rage27-Apr-05 22:36
professionalRage27-Apr-05 22:36 
GeneralRe: Need Your Help!!!! Pin
ThatsAlok27-Apr-05 23:07
ThatsAlok27-Apr-05 23:07 
Generalimport TStringGrid component to MFC Pin
27-Apr-05 15:51
suss27-Apr-05 15:51 
QuestionCan Use VirtualAllocEx( ) to Get Memory from Other Process? Pin
macauit27-Apr-05 14:49
macauit27-Apr-05 14:49 
AnswerRe: Can Use VirtualAllocEx( ) to Get Memory from Other Process? Pin
Ryan Binns27-Apr-05 19:15
Ryan Binns27-Apr-05 19:15 

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.