我有一个包含以下数字的数组(动态创建)
$numbers = array (200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 12000, 14000, 15000, 16000, 18000, 20000, 21000, 24000, 25000, 27000, 30000, 35000, 40000, 45000, 50000, 60000, 70000, 75000, 80000, 90000, 100000, 105000, 120000, 135000, 140000, 150000, 160000, 180000, 200000, 250000, 300000, 350000, 400000, 450000, 500000, 600000, 700000, 800000, 900000, 1000000)
Run Code Online (Sandbox Code Playgroud)
我想通过> =和<=创建新数组(已过滤),例如新数组包含的数字大于或等于(> =)大于800且小于或等于(<=)大于1600
New Array
(
[0] => 800
[1] => 1000
[2] => 1200
[3] => 1400 …Run Code Online (Sandbox Code Playgroud) 我在Delphi中有源代码我按照http://hscripts.com/tutorials/cpp/bitwise-operators.php为按位运算符在C++ Builder中转换它,但结果是不同的
Delphi中的源代码
procedure TForm1.Button1Click(Sender: TObject)
var
tmp, dynamicINT : integer;
begin
dynamicINT := 42080;
tmp := ((dynamicINT shl 1) or (dynamicINT shr 31) and $7FFFFFFF);
Edit1.Text := IntToHex(tmp, 4);
end;
Run Code Online (Sandbox Code Playgroud)
德尔福结果:148C0正确!
C++ Builder中的源代码
void __fasctall TForm1::Button1Click(TObject *Sender)
{
int tmp = 0;
int dynamicINT = 42080;
tmp = ((dynamicINT << 1) || (dynamicINT >> 31) && 0x7FFFFFFF);
Edit1->Text = IntToHex(tmp, 4);
}
Run Code Online (Sandbox Code Playgroud)
C++ Builder结果:0001???
转换有什么问题?
我正在使用C++ Builder 6和Delphi 7
我有一个数组,我想得到一个特定值的位置
例:
$my_array = array(0,2,5,3,7,4,5,2,1,6,9);
Run Code Online (Sandbox Code Playgroud)
我的搜索是5 号阵列中5 号的位置是(2和6)
如果我调用array_search函数,总是返回在数组女巫第一位置是2.
反正有没有获得两个具有特定价值的矿石?
test.php的
class AClass {
public function __construct()
{
echo '<strong style="color:blue;">AClass construct</strong><br>';
}
public function call()
{
$this->koko();
}
private function koko()
{
echo 'koko <br>';
}
}
class BClass extends AClass {
public function __construct()
{
echo '<strong style="color:red;">BClass construct</strong><br>';
parent::__construct();
}
public function momo()
{
echo 'momo <br>';
}
}
$xxx = new AClass(); // Output: AClass contruct ..... (where is BClass echo ?)
$xxx->call(); // Output: koko
$xxx->momo(); // Output: Fatal error: Call to undefined method AClass:momo() …Run Code Online (Sandbox Code Playgroud) 我有一个风格的三个简单的HTML按钮height- min-width-和border。一个带文本,第二个带非制动空间,最后一个带空文本。
我的问题是在浏览器视图上,带有空文本的最后一个按钮在不同的位置打印。
CSS:
.test {
height: 27px;
border: 1px solid #b4b1ff;
min-width: 54px;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<button class="test">Text</button> <!-- with text -->
<button class="test"> </button> <!-- with Non Breaking Space -->
<button class="test"></button> <!-- Empty ?? -->
Run Code Online (Sandbox Code Playgroud)
看小提琴