小编T.T*_*.T.的帖子

如何从批处理文件中以十六进制显示整数?

echo The error level is: %ERRORLEVEL%
Run Code Online (Sandbox Code Playgroud)

产生

>The error level is: 15
Run Code Online (Sandbox Code Playgroud)

我想要的是什么:

>The error level is: F
Run Code Online (Sandbox Code Playgroud)

我是否需要进行转换,还是有办法以不同的方式显示数字?

感谢您对正确方向的任何帮助表示赞赏.

windows math integer batch-file

2
推荐指数
2
解决办法
5812
查看次数

为什么某些头文件需要在Visual Studio中链接库?

我正在Visual Studio 2003 .NET中构建一个套接字程序

#include <winsock2.h>头文件但也注意到我必须链接WS2_32.lib以修复未解决的winsock函数错误.

在其他家庭作业项目中,我只添加了一个头文件并使用了它的功能 - 没有添加相应的库.

这是怎么回事?

某些标准头文件库是否已在Visual Studio或其他内容中预先链接?

谢谢!

c c++ visual-studio

2
推荐指数
2
解决办法
643
查看次数

如何保护两个进程之间共享内存中的字符串?

我有一块共享内存,其中包含两个进程之间的字符字符串和整数。

进程 A 写入它,进程 B 读取它(反之亦然)

确保进程 A 不会在进程 B 读取它的同时更新(写入)它的最有效和最有效的方法是什么?(我应该只在共享内存中使用标志,使用信号量,临界区......)

如果您能指出我正确的方向,我将不胜感激。

谢谢。

视窗,C++

c++ windows winapi ipc shared-memory

2
推荐指数
1
解决办法
1367
查看次数

对于大于32,767的值,如何转换为"signed int"并返回"signed short"?

码:

typedef signed   short  SIGNED_SHORT;   //16 bit
typedef signed   int    SIGNED_INT;     //32 bit


SIGNED_SHORT x;

x = (SIGNED_SHORT)(SIGNED_INT) 45512; //or any value over 32,767
Run Code Online (Sandbox Code Playgroud)

这就是我所知道的:

有符号16位:有
符号:从-32,768到32,767
无符号:从0到65,535

不要指望45512以适合x作为x被宣布为16位有符号整数.

上面的双重铸造如何以及如何做?

谢谢!

c c++ variables types casting

2
推荐指数
2
解决办法
1603
查看次数

javascript挂起浏览器

xmlDoc.load("cd_catalog.xml")

var cd=xmlDoc.getElementsByTagName("CD");
var id_set=1;
var id=xmlDoc.getElementsByTagName("ID"+id_set);

i=0;

function next()
{
if (i<id.length-1)
  {
  i++;
  display();

  }
}


function display()
{
document.write('<div class="dd">')
        document.write('<div class="blue" style="WIDTH:')
        document.write(cd[0].getElementsByTagName("ID"+id_set)[i].childNodes[0].nodeValue)
        document.write('"></div>')

document.write('</div>')

}


}
</script>

    <script type="text/javascript"> display()   </script>


    <br><input type="button" onclick="next()" value="next" ID="Button2" NAME="Button2"/>
Run Code Online (Sandbox Code Playgroud)

我看到了相关的问题,但不确定是否有帮助..我添加了next()函数,浏览器挂起,好像它正在加载一些东西,从来没有.如果没有next()调用,显示功能将起作用.我试图做一个变化的这个.

javascript browser

1
推荐指数
1
解决办法
1582
查看次数

如何在C中创建AJAX服务器端脚本?

我是第一次看AJAX,我想知道是否有可能从用C编写的服务器端CGI应用程序发出请求?

请问C应用程序只需要使用printf的数据,类似于的.asp例子吗?

c ajax cgi server-side

1
推荐指数
1
解决办法
4620
查看次数

验证所有复选框是否未被选中的快速方法?

如果取消选中所有复选框,是否有快速方法或功能可以告诉我真/假?没有通过阵列?(使用JS和HTML)

我的所有复选框都有相同的名称......

<form action="/cgi-bin/Lib.exe" method=POST name="checks" ID="Form2">
    <input type=checkbox name="us" value="Joe" ID="Checkbox1">
    <input type=checkbox name="us" value="Dan" ID="Checkbox2">
    <input type=checkbox name="us" value="Sal" ID="Checkbox3">
</form>
Run Code Online (Sandbox Code Playgroud)

html javascript forms validation input

1
推荐指数
2
解决办法
1万
查看次数

将cookie值设置为递增int

cookie有整数元素吗?每次按下某个按钮时,我都需要将cookie递增10.如何在第一次启动cookie时,它的下一个值是基于它的当前状态.

document.cookie + = 10;
得到10,然后是1010,然后是101010.
对,我dea但我需要整数值 -
需要10,20,30等......

html javascript cookies dom

1
推荐指数
1
解决办法
5118
查看次数

C中的自然排序 - "包含数字和字母的字符串数组"

寻找一种经过验证的生产算法. 看到这个例子, 但没有在网上或书中找到其他东西.

即file_10.txt> file_2.txt

谢谢.

c sorting algorithm natural-sort

1
推荐指数
1
解决办法
3697
查看次数

system()函数找不到可执行文件的可能原因是什么?

  if( system("tail -500 log.txt") == -1)
  {
      //Error calling tail.exe on log 
      //errno is a system macro that expands int returning
      //the last error. strerror() converts the error to it's
      //corresponding error message. 
      printf("Error calling tail.exe with system(): %s",strerror( errno ));

  }
Run Code Online (Sandbox Code Playgroud)

System()使用log.txt调用Tail.exe
All与调用它的可执行文件位于同一目录中.
获取错误ENOENT-没有这样的文件或目录
另外,指定所有内容的路径,相同的错误.

任何建议表示赞赏,谢谢.

c c++ windows winapi

1
推荐指数
1
解决办法
208
查看次数