小编fud*_*din的帖子

错误:声明终止不正确

#include<stdio.h>
#include<conio.h>

void insert(int arr[]);

# define LEN 10

int count;

void main(void)
{
  clrscr();
  int arr[]={20,21,22,23,24};
  insert(arr);
  getch();
}

void insert(int arr[])
{
  if(size==count)
    printf("no space");
    return;

  int index,value;
  printf("enter index and value");
  scanf("%d %d",index,value);
  for(int i=count-1;i>=index;i--)
  {
    arr[i+1]=arr[i];
    arr[i]=value;
    count++;
  }
  printf("insert succcess");

}
Run Code Online (Sandbox Code Playgroud)

c arrays

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

有没有办法可以从2个字节改变指针的大小?

我们可以无论如何从2个字节改变指针的大小,因此它可以占用超过2个字节?

c

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

复数打印程序出现故障

我已经开始研究C++语言.我对它很新.该程序从用户那里得到一个复杂的数字并将其打印出来.但它给了我很多错误,比如

prog.cpp: In function ‘int main()’:
prog.cpp:26: error: ‘GetReal’ was not declared in this scope
prog.cpp:26: error: ‘SetReal’ was not declared in this scope
prog.cpp:27: error: ‘GetImag’ was not declared in this scope
prog.cpp:27: error: ‘SetImag’ was not declared in this scope
prog.cpp:28: error: ‘print’ was not declared in this scope
prog.cpp: At global scope:
prog.cpp:34: error: expected unqualified-id before ‘)’ token
prog.cpp:40: error: expected unqualified-id before ‘float’
prog.cpp:40: error: expected `)' before ‘float’
prog.cpp: In function ‘void SetImag(float)’:
prog.cpp:64: …
Run Code Online (Sandbox Code Playgroud)

c++

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

分离界面的问题及实现

它是我第一次尝试在单独的头文件中分离类,但我收到一个错误.请帮助我.谢谢 代码:

我的主要功能:

#include <iostream>
#include <MyClass>
int MyClass::data;
int main()
{
    cout<<"data="<<MyClass::data;
    system("pause");
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

MyClass.h

#ifndef MyClass
#define <MyClass>
class MyClass
{
    static int data_;

};
#endif
Run Code Online (Sandbox Code Playgroud)

错误:致命错误C1083:无法打开包含文件:'MyClass.h':没有这样的文件或目录

c++ visual-studio-2008

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

PHP中的"Hello,World"

这是一个"Hello,World"代码片段.我试图使用XAMPP运行它,我使用Dreamweaver编写代码.执行时,页面不显示"Hello,World!".怎么会出错?

<!DOCTYPE html>
    <head>
        <title>Hello World | Hello and Welcome</title>
    </head>

    <body>
        <?php
            Echo "Hello, World!";
        ?>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

php

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

堆栈函数的实现在哪里?

我正在学习data structures and algorithms.我的老师告诉我以下内容:

push():push在堆栈中插入一个元素

pop():pop删除堆栈中最后插入的元素

size():返回堆栈中的元素数

isempty():返回一个布尔值,指示堆栈是否为空

top():返回堆栈的顶部元素,而不删除它; 如果stack为空,则返回错误.

这些功能的实现在哪里?这些built-in functions是C++吗?

c++ stack

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

从1Mbyte转换为Hex

我在理解以下文字时遇到问题,

8088支持1外部存储器的Mbyte.该存储空间是从视图上的地址范围储存在连续的地址数据的各个字节的软件点组织00000FFFFF.

现在我不知道作者如何从1 MB转换为FFFFF.有人可以帮帮我吗?

谢谢.

size binary microprocessors

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

验证表单中的多个字段

我是第一次进行测试.我阅读了这段代码并从中创建了自己的代码.问题是即使字段留空也不会出现任何错误.

这是我的小提琴.

请帮忙.谢谢.

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
{function validateForm()

var x=document.forms["myForm"]["name"].value;
if (x==null || x=="")
  {
  alert("Name must be filled out");
  return false;
  }

var y=document.forms["myForm"]["password"].value;
  {
if (y==null || y=="")
  alert("Password name must be filled out");
  return false;
  }
</script>
</head>

<body>

<form name="myForm" action="demo_form.asp" onsubmit="return validateForm()" method="post">
Name*: <input type="text" name="name"> <br>
Password*: <input type="password" name="password"><br>
Email: <input type="text" name="email"><br>
<input type="submit" value="Submit">
</form>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

javascript forms validation html5

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

在jQuery中按属性获取元素

我试图使用属性获取元素.我想将"卡安全代码"的文本更改为"CVV".有许多标签元素,所以我无法通过标签名称获取元素.

<label for="cvv">Card security code <span class="required">*</span></label>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

2d阵列添加

这个程序增加了两个矩阵,但它给出了太多错误,我无法解决它们.

错误:

阵列边界丢失

表达式语法

有任何想法吗?

#include<stdio.h>
#include<conio.h>

#define ROW=3
#define COL=3

int result[][COL];
void input(int arr[][COL]);
void add(int mat1[][COL],mat2[][COL]);
void print(int result[][COL]);

void main(void)
{
    int mat1[ROW][COL],mat2[ROW][COL];
    input(mat1);
    input(mat2);
    add(mat1,mat2);
    print(result);
    getch();
}

void input(int arr[][COL]);
{
    for(int i=0;i<row;i++)
        for(int j=0;j<col;j++)
        {
            printf("Enter element");
            scanf("%d",&arr[i][j]);
        }
}

void add(int mat1[][COL],int mat2[][COL])
{
    for(int i=0;i<row;i++)
        for(int j=0;j<col;j++)
        {
            result[i][j]=mat1[i][j]+mat2[i][j];
        }
}

void print(int result[][COL])
{
    for(int i=0;i<row;i++)
        for(int j=0;j<col;j++)
            printf("%d",result[i][j]);
}
Run Code Online (Sandbox Code Playgroud)

c c++

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