小编Raj*_*mar的帖子

未初始化变量的价值是多少?

可能重复:
是否已明确指定未初始化的数据行为?

我尝试了以下代码

#include<stdio.h>
void main()
{
int i; \
printf('%d',i);
}
Run Code Online (Sandbox Code Playgroud)

结果给出了VC++中的垃圾值,而tc中的垃圾值为零.什么是正确的价值?默认情况下,未初始化的变量的值是否为零?或者它会包含垃圾值?

接下来是一样的

#include<stdio.h> 
void main()
{
int i,j,num;
j=(num>0?0:num*num);
printf("\n%d",j);
}
Run Code Online (Sandbox Code Playgroud)

上面代码的输出是什么?

c initialization garbage

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

如何调整默认打开的java中的图像自动获取计算机分辨率

读取图像并在实际出现之前显示为闪烁.现在的问题是我想修复图像的分辨率,使其成为执行它的计算机.怎么做到这一点?

代码如下

import javax.swing.*;
import java.awt.*;

public class FrmSplash extends JWindow implements Runnable{
    public void run(){
        JLabel SplashLabel = new JLabel(new ImageIcon("Image001.jpg"));

            Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    getContentPane().add(SplashLabel,BorderLayout.CENTER);

    setLocation((screen.width),(screen.height));
    show();
}
}
Run Code Online (Sandbox Code Playgroud)

编译时出现以下错误注意:使用-Xlint重新编译:弃用以获取详细信息.再次使用-Xlint编译但更多种类的错误.

java swing resolution image awt

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

如何从左向右移动/滑动图像

我想从左到右滑动或移动图像

http://rajeevkumarsingh.wix.com/pramtechnology

阅读五角形框,移动好!

我尝试了一下但没有这样做我使用下面的代码

<script type="text/javascript">

<!--
var imgObj = null;
var animate ;
function init(){
   imgObj = document.getElementById('myImage');
   imgObj.style.position= 'absolute'; 
   imgObj.style.top = '240px';
   imgObj.style.left = '-300px';
   imgObj.style.visibility='hidden';
   moveRight();
} 
function moveRight(){
if (parseInt(imgObj.style.left)<=10)
{
   imgObj.style.left = parseInt(imgObj.style.left) + 5 + 'px';
   imgObj.style.visibility='visible';
   animate = setTimeout(moveRight,20); // call moveRight in 20msec
   //stopanimate = setTimeout(moveRight,20);
  }
else
  stop();
  f();
}

function stop(){
   clearTimeout(animate);
}
window.onload =init;
//-->
</script>
<img id="myImage" src="xyz.gif" style="margin-left:170px;" />
Run Code Online (Sandbox Code Playgroud)

Firefox和IE也存在某种解决问题.如何解决它们.此外,我无法如此清楚地移动这些东西.这可能吗?我希望它与javascript而不是闪存.

javascript javascript-events motion

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