Redian新闻
>
请教matlab,将一个二维的矩阵扩展到三维的最简单的办法?
avatar
请教matlab,将一个二维的矩阵扩展到三维的最简单的办法?# Computation - 科学计算
s*1
1
请教有关header file的几个问题
假设sub.h 和 sub.c 是header file 和与其对应的source file.
(1) 在sub.c开始都有 #include "sub.h"
我试着delete 以上的语句,compile和run时都没有问题。#include "sub.h"
在sub.c中,#include "sub.h" 是否多余??
(2) 试着将sub.h的name 改成 subbbbb.h, 结果也没有问题,是否header file 和与其
对应的source file 名字可以完全不一样?
(3) 又试着去掉.h, 并把heade file 的名字改成:
sub.h ----〉 subbbbb.c
再把main program 中开头的部分改成 #include "subbbbb.c"。 结果也没有问题。
.c 和 .h file 到底有没有不同?
(4) 将#include "subbbbb.c" (或者#include "subbbbb.h", #include "sub.h")
avatar
w*n
2
【 以下文字转载自 Hardware 讨论区 】
发信人: winneragain (厚道牧民), 信区: Hardware
标 题: 双系统不能启动的问题 :BootMGR is missing
发信站: BBS 未名空间站 (Wed Feb 27 20:56:30 2008)
HP 的笔记本, 原装vista, 上个月又装了XP。一直用,没事。
今天进去vista里面,把C盘shrink 了一下,然后重启。
结果屏幕不在出现双系统界面,而是:
BootMGR is missing
press ctrl alt del to restart
请问如何解决这个问题?
前5个答案每人20新伪币
avatar
m*f
3
比如一个二维的是这样
A =
a b c d
e f g h
i j k l
然后变成
B(:,:,1) =
ax bx cx dx
ex fx gx hx
ix jx kx lx
B(:,:,2) =
ay by cy dy
ey fy gy hy
iy jy ky ly
B(:,:,3) =
az bz cz dz
ez fz gz hz
iz jz kz lz
最简单的怎么做?谢谢!
avatar
c*t
4
You really should get a C/C++ book (such as K&R) and read it. This
board is not a good place for learning the extreme basics. It is a
place to ask questions after you get at least some basic understandings
of the languages.
p.s. It is rude and in violation the BBS rule to spam your post in
more than 3 boards.


题。

【在 s********1 的大作中提到】
: 请教有关header file的几个问题
: 假设sub.h 和 sub.c 是header file 和与其对应的source file.
: (1) 在sub.c开始都有 #include "sub.h"
: 我试着delete 以上的语句,compile和run时都没有问题。#include "sub.h"
: 在sub.c中,#include "sub.h" 是否多余??
: (2) 试着将sub.h的name 改成 subbbbb.h, 结果也没有问题,是否header file 和与其
: 对应的source file 名字可以完全不一样?
: (3) 又试着去掉.h, 并把heade file 的名字改成:
: sub.h ----〉 subbbbb.c
: 再把main program 中开头的部分改成 #include "subbbbb.c"。 结果也没有问题。

avatar
e*s
5
rebuild your MBR
or
从别的Vista系统里面烤一个bootmgr过去

【在 w*********n 的大作中提到】
: 【 以下文字转载自 Hardware 讨论区 】
: 发信人: winneragain (厚道牧民), 信区: Hardware
: 标 题: 双系统不能启动的问题 :BootMGR is missing
: 发信站: BBS 未名空间站 (Wed Feb 27 20:56:30 2008)
: HP 的笔记本, 原装vista, 上个月又装了XP。一直用,没事。
: 今天进去vista里面,把C盘shrink 了一下,然后重启。
: 结果屏幕不在出现双系统界面,而是:
: BootMGR is missing
: press ctrl alt del to restart
: 请问如何解决这个问题?

avatar
m*f
6
算了,repmat+reshape,就决定这样了
avatar
s*1
7
You should not respond to other people's question in this manner. You may
well ignore it if you are not interested. My question is carefully proposed.
I asked some engineers about it they were not sure either. It is not a spam
as you called it.

【在 c*****t 的大作中提到】
: You really should get a C/C++ book (such as K&R) and read it. This
: board is not a good place for learning the extreme basics. It is a
: place to ask questions after you get at least some basic understandings
: of the languages.
: p.s. It is rude and in violation the BBS rule to spam your post in
: more than 3 boards.
:
: 其
: 题。

avatar
k*t
8
试着用DVD安装盘修复下vista的启动
比较奇怪你都会在安装完xp之后恢复vista与xp的双启动,这么个小问题自己搞不定?

【在 w*********n 的大作中提到】
: 【 以下文字转载自 Hardware 讨论区 】
: 发信人: winneragain (厚道牧民), 信区: Hardware
: 标 题: 双系统不能启动的问题 :BootMGR is missing
: 发信站: BBS 未名空间站 (Wed Feb 27 20:56:30 2008)
: HP 的笔记本, 原装vista, 上个月又装了XP。一直用,没事。
: 今天进去vista里面,把C盘shrink 了一下,然后重启。
: 结果屏幕不在出现双系统界面,而是:
: BootMGR is missing
: press ctrl alt del to restart
: 请问如何解决这个问题?

avatar
h*z
9
Including a file A in another file B is equivalent to copying the contents
of A and pasting it in B. All included files are treated the same, no
matter what their names are.


题。

【在 s********1 的大作中提到】
: 请教有关header file的几个问题
: 假设sub.h 和 sub.c 是header file 和与其对应的source file.
: (1) 在sub.c开始都有 #include "sub.h"
: 我试着delete 以上的语句,compile和run时都没有问题。#include "sub.h"
: 在sub.c中,#include "sub.h" 是否多余??
: (2) 试着将sub.h的name 改成 subbbbb.h, 结果也没有问题,是否header file 和与其
: 对应的source file 名字可以完全不一样?
: (3) 又试着去掉.h, 并把heade file 的名字改成:
: sub.h ----〉 subbbbb.c
: 再把main program 中开头的部分改成 #include "subbbbb.c"。 结果也没有问题。

avatar
k*f
10
I think your questions are follow-ups to your earlier post.

Yes. sub.h is not necessary for sub.c to compile.

Yes.
题。
The extension of the header file can be anything. In fact, C++ standard
header files have no extension, e.g.
Now the real answer to your questions. Header files usually contain the
prototype of functions and definitions of data types that are shared among
source files.
Declaring function prototype is necessary in ANSI C. Using the same header
file allows the compiler

【在 s********1 的大作中提到】
: 请教有关header file的几个问题
: 假设sub.h 和 sub.c 是header file 和与其对应的source file.
: (1) 在sub.c开始都有 #include "sub.h"
: 我试着delete 以上的语句,compile和run时都没有问题。#include "sub.h"
: 在sub.c中,#include "sub.h" 是否多余??
: (2) 试着将sub.h的name 改成 subbbbb.h, 结果也没有问题,是否header file 和与其
: 对应的source file 名字可以完全不一样?
: (3) 又试着去掉.h, 并把heade file 的名字改成:
: sub.h ----〉 subbbbb.c
: 再把main program 中开头的部分改成 #include "subbbbb.c"。 结果也没有问题。

avatar
y*e
11
其实他说得没错,你的这些问题确实非常那个基本,
名字没有关系的,有的平台上还把头文件叫 .hpp
你说的那些engineers是做C/C++的吗,如果是的话,他们都应该被fired

proposed.
spam

【在 s********1 的大作中提到】
: You should not respond to other people's question in this manner. You may
: well ignore it if you are not interested. My question is carefully proposed.
: I asked some engineers about it they were not sure either. It is not a spam
: as you called it.

avatar
O*e
12
Take coconut's advice, spend the money and get a C or C++ book. Given that
you know nothing about programming, any book with a lot of example would
do. Kernighan and Ritchie (suggested by coconut) is the standard reference
for all C programmers, but judging from the type of questions you have been
asking, it might not be suitable for you because it really is a reference
book with few examples and not a textbook with many illustrative examples.
Without a book, you are trying to learn how to pro

【在 s********1 的大作中提到】
: You should not respond to other people's question in this manner. You may
: well ignore it if you are not interested. My question is carefully proposed.
: I asked some engineers about it they were not sure either. It is not a spam
: as you called it.

avatar
O*e
13

If the contents of sub.h are not needed by sub.c, then #include "sub.h"
is redundant.

You can call the header file by any name you want.
题。
You can call the header file by any name you want, although some
preprocessors might make certain assumptions regarding the .h or .c
file extensions.
(4) 将#include "subbbbb.c" (或者#include "subbbbb.h", #include "sub.h")
完全从main program里除去, 只compile main program 和sub.c。
在linux 上compile,run 一切正常。 visual studio 2005 上也只在compile 时给

warning, run

【在 s********1 的大作中提到】
: 请教有关header file的几个问题
: 假设sub.h 和 sub.c 是header file 和与其对应的source file.
: (1) 在sub.c开始都有 #include "sub.h"
: 我试着delete 以上的语句,compile和run时都没有问题。#include "sub.h"
: 在sub.c中,#include "sub.h" 是否多余??
: (2) 试着将sub.h的name 改成 subbbbb.h, 结果也没有问题,是否header file 和与其
: 对应的source file 名字可以完全不一样?
: (3) 又试着去掉.h, 并把heade file 的名字改成:
: sub.h ----〉 subbbbb.c
: 再把main program 中开头的部分改成 #include "subbbbb.c"。 结果也没有问题。

avatar
t*t
14
别人回你就不错了, 你还挑三拣四的
刚才有人说得不错, 你问的那些"engineers", 如果是C/C++的程序员, 那他们都该被炒
鱿鱼

proposed.
spam

【在 s********1 的大作中提到】
: You should not respond to other people's question in this manner. You may
: well ignore it if you are not interested. My question is carefully proposed.
: I asked some engineers about it they were not sure either. It is not a spam
: as you called it.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。