我观察到,有在某些时候<?和>?运营商GCC.如何在GCC 4.5下使用这些?他们被删除了,如果是的话,何时被删除?
Offset block_count = (cpfs->geo.block_size - block_offset) <? count;
cpfs.c:473: error: expected expression before ‘?’ token
Run Code Online (Sandbox Code Playgroud) 我曾经见过C++,其分配值的-wired-操作者如果比..更大
它的组合?,<和=
例如,如果value大于x,则x = value
我不是故意的 x=(x<value)x:value
这是某种形式 x<?=value
但我完全记不起来了,也无法在网上找到它......有人能提醒我吗?
谢谢,
我在代码中看到<?=和>?=:http://community.topcoder.com/stat?c = proby_solution&rm = 151152&rd = 585&pm = 2923&cr = 310333
我尝试编译没有包括测试它是否是标准,但它不起作用.然后我添加了包含,但它仍然给出了相同的错误:
question-mark.cpp:15:5:错误:在'?'之前预期的primary-expression token question-mark.cpp:15:6:error:在'='之前预期的primary-expression标记question-mark.cpp:15:9:error:expected':'before';' token question-mark.cpp:15:9:error:在';'之前预期的primary-expression 代币
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main()
{
int x = 3;
int y = 2;
x >?= y;
printf("x = %d\n", x);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
以下是链接代码中的使用方法:
x <?= h[i][j]; // x = (h[i][j] < x) ? h[i][j] : x;
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我浏览了另一个程序员代码编写的代码,试图从中学习.我最终遇到了这段代码:
inline const FLOAT minx() const { return p1.x <? p2.x; }
inline const FLOAT maxx() const { return p1.x >? p2.x; }
Run Code Online (Sandbox Code Playgroud)
这段代码没有编译,我能够通过将代码改为此来使其工作:
inline const FLOAT minx() const { return p1.x < p2.x ? p1.x : p2.x; }
inline const FLOAT minx() const { return p1.x > p2.x ? p1.x : p2.x; }
Run Code Online (Sandbox Code Playgroud)
通过这样做,我已经可以假设代码应该做什么.但搜索我没有找到任何其他以这种方式实现它的例子.这只是坏代码,甚至没有编译,或者这实际上是否适用于某些编译器(以及如何?).
谢谢.
可能重复:
>?=运算符是什么意思?
我找到了这段代码
...
for(k=i+1;k<j;k++) r <?= go(i,k,b)+go(k,j,b);
for(k='A';k<='Z';k++) r <?= 1+go(i,j,k);
...
Run Code Online (Sandbox Code Playgroud)
我对<?=运营商很感兴趣.在我看来,它应该r与运营商右侧的价值进行比较,如果右侧大于r它应该分配右侧的情况r.我想知道这个(和我认为的类似操作符)在哪里定义,我应该怎么做才能使它们与g ++编译器一起使用?
可能重复:
>?=运算符是什么意思?
我遇到过这条线,
bot <?= fnet[v][u] ? fnet[v][u] : ( cap[u][v] - fnet[u][v] );
Run Code Online (Sandbox Code Playgroud)
这个<?=标志是什么意思?Visual Studio 2012表示它不存在,那么它是什么?也许是在以前的某些版本中?
谢谢
的意义是什么 ?运营商在下面的代码?它在哪里使用?
adj[i][j] <?= adj[i][k] >? adj[k][j]
Run Code Online (Sandbox Code Playgroud)
我无法在其他地方找到这个运营商
可能重复:
C扩展名:<?和>?运算符
>?=运算符是什么意思?
我在互联网上搜索一些C++代码,发现了这个:
num <?= num2-num3+num4;
Run Code Online (Sandbox Code Playgroud)
有谁知道这个运营商代表什么?我用Google搜索但发现了什么.
我在topcoder中的SnapDragon解决方案中多次观察到这一行http://community.topcoder.com/stat?c=problem_solution&rm=166781&rd=5865&pm=3115&cr=272072.上面一行从底部出现在第6行.这是代码
vector<string> tokenize(string s, string ch) {
vector<string> ret;
for( int p = 0, p2; p < s.size(); p = p2+1 ) {
p2 = s.find_first_of(ch, p);
if( p2 == -1 ) p2 = s.size();
if( p2-p > 0 ) ret.push_back( s.substr(p, p2-p) );
}
return ret;
}
vector<int> tokint(string s, string ch) {
vector<int> ret;
vector<string> p = tokenize(s, ch);
for( int i = 0; i < p.size(); i++ )
ret.push_back( atoi(p[i].c_str()) );
return ret;
}
vector<vector<int> > tokmat(vector<string> …Run Code Online (Sandbox Code Playgroud)