what is this?..
#define number 3
//...
--number;
let me introduce "strcpy"
strcpy(char *_destination, const char *_source);
are u sure that is bubble sort?..
what is this?..
#define number 3
//...
--number;
let me introduce "strcpy"
strcpy(char *_destination, const char *_source);
are u sure that is bubble sort?..
If you had read any of the previous posts, you would have seen this point:
I don't have problems with that..
u can use
FindFirstFileW(...,...);
and dont forget
WIN32_FIND_DATAW
in the source file..u can just go..
#include<string>
#include...
#include"someheader.h"
#include"anotherheader.h"
and remove #include<string> in the "someheader.h"
char gradeLetter [4] = {'a', 'b', 'c', 'd'};
what do u think...
int gradeLetter [4] = {'a', 'b', 'c', 'd'};
while(0 < 1)
{
stream_out<<"a ";
}
dim x as integer
dim y as integer
dim str as string
private sub ON_BUTTON_CLICK(...sender as OBJECT,... e as MOUSE_EVENT_ARGS)
x = e.X
y = e.Y
str = ListView1.GetItemAt(x, y).Text
end sub
post header files...please...
try
#include <iostream>
//...or
using namespace std;
//...
your problems is..
bool Solver::Solve()
{
//...........
else // stuck?
{
if(trys != b)
{
it++; // another iteration
Solve(); //-------------------- [B]HERE [/B]----------------------//
}
else // stuck and nothing happend? unsolvible...
return false;
}
//............
if(trys != b) // you did somthing, try again
{
it++;
Solve(); //-------------------- [B]OR HERE[/B] ----------------------//
}
}
use..
//...
fflush(stdin);
system("pause");
//...
try to replace
system("pause');
with..
cin.ignore();
try
//----------------------------------------------------------------------------
//...
private: System::Int32 m_x, m_y;
//...
//----------------------------------------------------------------------------
ON FORM1 MOUSE MOVE
{
m_x = e->X;
m_y = e->Y;
}
//----------------------------------------------------------------------------
ON TEXTBOX1 MOUSE LEAVE
{
toolTip1->Hide(this);
}
//----------------------------------------------------------------------------
private: System::Void textBox2_MouseHover(System::Object^ sender, System::EventArgs^ e)
{
if( radioButton4->Checked )
{
toolTip1->Show("Hello",this,m_x,m_y);
}
}
//----------------------------------------------------------------------------
ur using 32 bit compiler rit...
see this...
__int64 arry[201];
// in 32 bit compiler will be
int arry[201];
// maks array size = 65535
__int64 arry[2000000];
// ?????
Yeay...maks array size is 65535 or 65536...i dont know exactly...
both of them...
ex:
//-------------- <file1.h> -----------------//
#include <iostream> //..header file
class CClass
{
//...
void funct(std::string &str);
};
//-------------- </file1.h> -----------------//
//-------------- <file1.cpp> -----------------//
#include "file1.h" // header file
//#include <...h>
void CClass::funct(std::string &str)
{
//...
}
//...
//-------------- </file1.cpp> -----------------//
//-------------- <main_source_file> -----------------//
#include "file1.h" // header file
int main()
{
CClass c_class;
//...
return 0;
}
//-------------- </main_source_file> -----------------//
congratulations...:)
Of course you can always make your own linked list cikara21 but if you are using VC++ why should you? When you can have this instead http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx
of course...Just trying to help...:)
Here...hope u can read it...:)
//##########################################
#pragma once
struct LinkList
{
int a;
LinkList *Link;
};
namespace "Link" {
using namespace System;
//....
public ref class Form1 : public System::Windows::Forms::Form
{
//...
private: LinkList *new_link;
//...
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
//...
list = new LinkList;
list->a = 2;
//...
}
//....
};
}
//##########################################
Still, I didn't managed to solve it :( . My question remains: how can I pass a variable to the function that it's executed when my button is pressed. I want (if it's possible) to do
TestBtn->OnClick = myfunction(parameter);
???
...?...
it's "Not an allowed type", :( ...Sorry...:)
...!...
void __fastcall TForm1::OnClick1(TObject *Sender)
{
ShowMessage("Button1 clicked");
}
void __fastcall TForm1::OnClick2(TObject *Sender)
{
ShowMessage("Button2 clicked");
}
void __fastcall TForm1::OnClick3(TObject *Sender)
{
ShowMessage("Button3 clicked");
}
//... repeat until "void __fastcall TForm1::OnClick10(TObject *Sender)"...
//######################################
for (x = 0; x < 10; x++)
{
TestBtn[i] = new TButton(this);
TestBtn[i]->Parent = this;
switch(i)
{
case 0:
TestBtn[i]->OnClick = OnClick1;
break;
case 1:
TestBtn[i]->OnClick = OnClick2;
break;
case 2:
TestBtn[i]->OnClick = OnClick3;
break;
//... repeat until case 9..
}
TestBtn[i]->Caption = "My button " + IntToStr(x);
TestBtn[i]->Top = 100;
TestBtn[i]->Left = 100 + 10 * x;
}
try it...
try yhis...
//######################################
class TForm1:public TForm
{
//...
public:
TButton *TestBtn[10]
//...
};
//######################################
for (x = 0; x < 10; x++)
{
TestBtn[i] = new TButton(this);
TestBtn[i]->Parent = this;
TestBtn[i]->OnClick = myfunction;
TestBtn[i]->Caption = "My button " + IntToStr(x);
TestBtn[i]->Top = 100;
TestBtn[i]->Left = 100 + 10 * x;
m_x = x;
}
//######################################
class TForm1:public TForm
{
private:
// create temp var..
int m_x;
//...
};
void __fastcall TForm1::myfunction1(int x)
{
ShowMessage("Button " + IntToStr(x) + " clicked");
}
void __fastcall TForm1::myfunction(TObject *Sender)
{
myfunction1(m_x);
}
//######################################
TButton *TestBtn = new TButton(this);
TestBtn->OnClick = myfunction;
TestBtn->Parent = this;
for (x = 0; x < 10; x++)
{
TestBtn->Caption = "My button " + IntToStr(x);
TestBtn->Top = 100;
TestBtn->Left = 100 + 10 * x;
m_x = x;
TestBtn->OnClick(this/*sender*/);
}
//######################################
try..
SetWindowTextA(edit,"TEST");
or
SetWindowTextW(edit,L"TEST");
TestBtn = new TButton(this);
TestBtn->Parent = this;
TestBtn->Caption = "Check";
send a message...receive a message...??
what device?...
//...
void __fastcall TForm1::example(void)
{
TestBtn = new TButton();
TestBtn->Visible = false;
}
a little help...
class A
{
int valueA;
class B
{
int valueB;
public:
B(){}
B(int x):valueB(x)
{
std::cout<<"Class B"<<std::endl;
}
int get_value()
{
return valueB;
}
};
public:
A(){}
B b;
A(int x):valueA(x),b(x)
{
std::cout<<"Class A"<<std::endl;
}
void display(void)
{
std::cout<<"Value B "<<b.get_value()<<std::endl;
}
};
int main()
{
A a(99)
a.display();
return 0;
}
class A
{
public:
int function1()
{
return 1; // ...
}
};
class B
{
A a;
public:
int function1()
{
return a.function1();
}
};
//...
if (enhp < 1)
break;
enhp = enhp-random_integer;
//...
Form2 ^form2 = gcnew Form2();
form2->Show(this);
post something that needed... Stash::fetch(...???...)
or....
int binary_search(int arry[], int size)
{
int first = 0;
int last = size - 1;
int middle = 0;
int key = 0;
cout<<"What number would you like to search for in the arry : ";
cin>>key;
for(;first<=last;)
{
middle = ((first)+(last)) / 2;
if(arry[middle] > key)
last = middle-1;
else if (arry[middle] < key)
first = middle+1;
else
return middle;
}
std::cout<<"??? Not found\n";
return -1;
}
this is binary search algorithm...hope u understand this...
int BinarySearch(int arr[], int value, int low, int high)
{
if (high < low)
return -1; // not found
int mid = (low + high) / 2;
if (arr[mid] > value)
return BinarySearch(arr, value, low, mid-1);
else if (arr[mid] < value)
return BinarySearch(arr, value, mid+1, high);
else
return mid; // found
}
i mean...
something like this one...
//... 1
myGame.deal();
myGame.showdown();
//... 2
myGame.deal();
myGame.showdown();
can i get the different result every time i deal???...
//... memcpy...
//... use memcmp(...,...,...);
//...
//...to compare two string :
int s_compare(const char *str1, const char *str2)
{
if (strlen(str1) != strlen(str2))
return 1;
for (;*str1!='\0';*str1++,*str2++)
if (*str1 != *str2)
return 1;
return 0;
}
// what's this...??
if ((cmd[0] == "M") && (cmd[1] == "S") && (cmd[3] == "G"))
{
PA_OutputText(1, 1, lineNum, packets); //show on DS screen
}
// maybe, if (cmd[0] == 'M')
create this class...
class Age
{
//...up to u..:)
};
class Height
{
//...up to u..:)
};
class Weight
{
//...up to u..:)
};
class Person
{
//...up to u..:)
};
<iostream>
just like it...
Person::Person(std::string _name)
{
//...
}
char T[25];
fgets( T,25, stdin);
work fine with my cmplr...
Library: Use User32.lib, make sure link correctly..