你好我对c ++变量类型(char)有一些疑问 我在一些网站上读到这个字符支持范围从(-128到127)和无符号(0到255)。这是什么意思?
char支持的不仅仅是数字,为什么他们说(-128到127)?
这个范围是什么意思?
什么范围?我的另一个问题是:什么时候可以使用这个
--2017-02-13 18:04:46-- http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip
Resolving chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)... 64.233.191.128, 2607:f8b0:4001:c0c::80
Connecting to chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)|64.233.191.128|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2692616 (2.6M) [application/zip]
Saving to: `chromedriver_linux64.zip'
0% [ ] 0 --.-K/s 100%[======================================>] 2,692,616 --.-K/s in 0.009s
wget: unable to resolve host address `.'
FINISHED --2017-02-13 18:04:48--
Total wall clock time: 1.5s
Downloaded: 1 files, 2.6M in 0.009s (281 MB/s)
The command "wget http://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip - unzip chromedriver_linux64.zip - sudo chmod u+x chromedriver - sudo mv chromedriver /usr/bin/ - export CHROME_BIN=chromium-browser - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 - ./travis_before_install" failed and exited with 4 during .
Your build has been stopped.
Also, Could someone please let me know, why travis wouldnt run this?
`The command "bundle exec cucumber" exited with 2.`
UPDATE: I updated the file fixing the indentation in the `before_script` . The latest error i get is
0.08s$ unzip chromedriver_linux64.zip
Archive: chromedriver_linux64.zip
inflating: chromedriver
before_script.10
0.01s$ sudo chmod u+x chromedriver
before_script.11
0.01s$ sudo mv chromedriver /usr/bin/
before_script.12
0.00s$ export CHROME_BIN=chromium-browser
before_script.13
0.00s$ export DISPLAY=:99.0
before_script.14
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
before_script.15
3.01s$ sleep 3
2.55s$ bundle exec cucumber
end of file reached (EOFError)
The command "bundle exec cucumber" exited with 2.
Done. Your build exited with 1.
**Update:** I tried fixing up the identation errors in the script as. The new error i get is
0% [ ] 0 --.-K/s 100%[======================================>] 2,692,616 --.-K/s in 0.01s
2017-02-14 11:00:45 (173 MB/s) - ‘chromedriver_linux64.zip’ saved [2692616/2692616]
before_script.9
0.08s$ unzip chromedriver_linux64.zip
Archive: chromedriver_linux64.zip
inflating: chromedriver
before_script.10
0.01s$ sudo chmod u+x chromedriver
before_script.11
0.01s$ sudo mv chromedriver /usr/bin/
before_script.12
0.00s$ export CHROME_BIN=chromium-browser
before_script.13
0.00s$ export DISPLAY=:99.0
before_script.14
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
before_script.15
3.01s$ sleep 3
2.55s$ bundle exec cucumber
**end of file reached (EOFError)**
The command "bundle exec cucumber" exited with 2.
Done. Your build exited with 1.
为什么我们需要在char之前设置unsigned或signed或...?
使用此操作(也使用const char * Data;
Data = "dddddddddddddddddddddddddddddddddddddddddddddddde21312313dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde21312313dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde21312313dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde21312313dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde21312313dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd";
)系统自动检测char的长度并保持正常和标准大小的存储大小...为什么我们需要设置*
的大小这个并具有动态大小并跳过静态大小?
或者这个动作为什么我们需要((char Data[255])
)了? !
答案 0 :(得分:1)
char支持不只是数字,为什么他们说(-128到127)?
实际上,你错了。 char
s 只是数字。您正在考虑这些数字的ASCII表示。例如,您看到的d
实际上是数字100。
因此,可以说签名char
可以容纳的唯一值在-128→127范围内。但是,该语句假定没有限定符的char
已签名,并非总是如此。