很多关于C的问题 [英] many question on C

查看:50
本文介绍了很多关于C的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好专家来回答以下问题:::提前谢谢。


1. fgets()和gets()哪个功能可以安全使用?为什么? />
2.什么是远指针?我们在哪里使用它?

3.错误''Null Pointer Assignment''是什么意思导致

这个错误?

4什么是近,远和巨大的指针?

占用了多少字节?

5.如何从内存位置远的
地址获取分段和偏移地址? ?

6.什么是位字段?在结构

声明中使用位字段有什么用?

7.对于哪个编号系统,二进制数1101100100111100可以轻松转换为
到?

8.哪个位运算符适合检查

特定位是打开还是关闭?

9.你怎么能增加一个动态分配的数组的大小?

10.当重新分配内存时,如果任何其他指针指向相同的内存,你必须重新调整这些其他指针或他们会自动重新调整吗?

11.什么是目标文件?你怎么能访问目标文件?

12. atoi(),itoa()和gcvt()的功能是什么?

再见,

回复我 de ************** @ rediffmail .com

解决方案

ROSY< de ************** @ rediffmail.com>潦草地写了下面的内容:

你好专家来回答以下问题:::提前谢谢。
1. fgets()和gets()哪个函数可以安全使用,为什么?


fgets()。当然。 gets()是一个等待发生的错误。

2.什么是远指针?我们在哪里使用它?


没有这样的东西。

3.错误''空指针赋值'是什么意思?导致这个错误的原因是什么?


也许你通过指向

空指针引起了未定义的行为。

4.什么是近,远和巨大指针?它们占用了多少字节?


没有这样的东西。

5.你如何从内存位置的远地址获得分段和偏移地址?


没有这样的东西。

6.什么是位字段?结构
声明中的位域有什么用?


这个想法是多个后续位域被压缩到

相同的字节,节省了空间。当然,实现没有义务这样做。$ / b
。对于哪个编号系统,二进制数1101100100111100可以轻松转换为?


二进制?除此之外,至少四分体,八进制,十六进制。任何

,其基数是2的幂。为什么你认为这是一个C问题?

8.哪个位运算符适合检查是否
特定位是打开还是关闭?


&运算符。

9.如何增加动态分配数组的大小?


Realloc()它。

10.当重新分配内存时,如果任何其他指针指向相同的内存,你必须重新调整这些其他指针或者它们会自动重新调整吗?


好​​悲伤。你怎么看?当然你必须通过

手重新调整它们。您是否希望实现能够理解您的想法?

11.什么是目标文件?你怎么能访问目标文件?


目标文件是C转换为的内容。访问它是在外面

C的范围。

12. atoi(),itoa()和gcvt()函数有什么作用?




没有itoa()这样的功能。 atoi()是一个穷人的strtol()。

没有gcvt()这样的功能。


我希望我没有'''只为你做功课。


-

/ - Joona Palaste(pa*****@cc.helsinki.fi) - -------------------------- \

| 飞翔的柠檬树中的金鸡王G ++ FR FW + M-#108 D + ADA N +++ |

| http://www.helsinki.fi/~palaste W ++ B OP + |

\ -----------------------------------------芬兰的规则! ------------ /

我的一个朋友正在进入伏都教针灸。你不必进入她的b
办公室。你只是走在街上......哦,那就好多了!"

- Stephen Wright




ROSY <德************** @ rediffmail.com>在消息中写道

news:73 ************************** @ posting.google.c om ...

你好专家来回答以下问题:::提前谢谢。
是的,当然。在这里,我为你完成了你的任务
1. fgets()和gets()哪个函数可以安全使用,为什么?


获得

2.什么是远指针?我们在哪里使用它?


a far指针是一个指针,用于处理小于64K的数据

3.错误''空指针赋值'是什么意思,是什么原因造成的?这个错误?


当程序执行a = NULL时会导致此错误;

4.什么是近,远和巨大的指针?它们占用了多少字节?


近使用4个字节,远使用2个字节,大量使用1个字节


5.如何从中获取分段和偏移地址一个内存位置的远地址?


段是指针/ 2,偏移量是指针+ 64K


6.什么是位域?结构
声明中的位域有什么用?


位字段是整数数组

7.二进制数1101100100111100可以轻松转换为哪个编号系统?


浮点

8.哪个位运算符适合检查特定位是打开还是关闭?


OR运算符

9.如何增加动态分配数组的大小?


with strcat

10.当重新分配内存时,如果任何其他指针指向相同的内存,你必须重新调整这些其他指针或者他们会自动重新调整吗?


自动

11.什么是目标文件?你怎么能访问目标文件?


目标文件继承自FILE类

12. atoi(),itoa()和gcvt()函数有什么作用?


atoi:将整数转换为ascii

itoa:反转,将ascii转换为文本

gcvt将unsigned short转换为unsigned long

再见,




是的,我希望你不要再来了


jacob navia< ja ********* @ jacob.remcomp.fr>潦草地写下:

ROSY <德************** @ rediffmail.com>在消息中写道
新闻:73 ************************** @ posting.google.c om ...

你好专家来回答以下问题:::提前谢谢。是的,当然。在这里,我为你完成了你的任务


1. fgets()和gets()哪个函数可以安全使用?为什么?



得到




(剪辑)


干得好,雅各布!我喜欢这些答案!


-

/ - Joona Palaste(pa*****@cc.helsinki.fi)---- ----------------------- \

| 飞翔的柠檬树中的金鸡王G ++ FR FW + M-#108 D + ADA N +++ |

| http://www.helsinki.fi/~palaste W ++ B OP + |

\ -----------------------------------------芬兰的规则! ------------ /

我的绝对方面可能是......

- Mato Valtonen


hello experts plz answer following questions::: thanks in advance.

1. Out of fgets() and gets() which function is safe to use and why?
2. What is a far pointer? where we use it?
3. What does the error ''Null Pointer Assignment'' mean and what causes
this error?
4. What is near, far and huge pointers? How many bytes are occupied by
them?
5. How would you obtain segment and offset addresses from a far
address of a memory location?
6. What are bit fields? What is the use of bit fields in a Structure
declaration?
7. To which numbering system can the binary number 1101100100111100 be
easily converted to?
8. Which bit wise operator is suitable for checking whether a
particular bit is on or off?
9. How can you increase the size of a dynamically allocated array?
10. When reallocating memory if any other pointers point into the same
piece of memory do you have to readjust these other pointers or do
they get readjusted automatically?
11. What is object file? How can you access object file?
12. What do the functions atoi(), itoa() and gcvt() do?
bye,
reply me at de**************@rediffmail.com

解决方案

ROSY <de**************@rediffmail.com> scribbled the following:

hello experts plz answer following questions::: thanks in advance. 1. Out of fgets() and gets() which function is safe to use and why?
fgets(). Definitely. gets() is a bug waiting to happen.
2. What is a far pointer? where we use it?
There is no such thing.
3. What does the error ''Null Pointer Assignment'' mean and what causes
this error?
Perhaps you have caused undefined behaviour by indirecting through a
null pointer.
4. What is near, far and huge pointers? How many bytes are occupied by
them?
There is no such thing.
5. How would you obtain segment and offset addresses from a far
address of a memory location?
There is no such thing.
6. What are bit fields? What is the use of bit fields in a Structure
declaration?
The idea is that multiple subsequent bitfields get compressed into the
same byte, saving space. Of course the implementation is not obliged to
do this.
7. To which numbering system can the binary number 1101100100111100 be
easily converted to?
Binary? Other than that, quadrinary, octal, hexadecimal at least. Any
whose radix is a power of 2. Why do you think this is a C question?
8. Which bit wise operator is suitable for checking whether a
particular bit is on or off?
The & operator.
9. How can you increase the size of a dynamically allocated array?
Realloc() it.
10. When reallocating memory if any other pointers point into the same
piece of memory do you have to readjust these other pointers or do
they get readjusted automatically?
Good grief. What do you think? Of course you have to readjust them by
hand. Do you expect the implementation to read your mind?
11. What is object file? How can you access object file?
An object file is what C gets translated to. Accessing it is outside
the scope of C.
12. What do the functions atoi(), itoa() and gcvt() do?



There is no such function as itoa(). atoi() is a poor man''s strtol().
There is no such function as gcvt().

I hope I didn''t just do your homework for you.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"A friend of mine is into Voodoo Acupuncture. You don''t have to go into her
office. You''ll just be walking down the street and... ohh, that''s much better!"
- Stephen Wright



"ROSY" <de**************@rediffmail.com> wrote in message
news:73**************************@posting.google.c om...

hello experts plz answer following questions::: thanks in advance. Yes, sure. Here, I did your assignment for you
1. Out of fgets() and gets() which function is safe to use and why?
gets
2. What is a far pointer? where we use it?
a far pointer is a pointer that addresses data smaller than 64K
3. What does the error ''Null Pointer Assignment'' mean and what causes
this error?
This error is caused when the program does a = NULL;
4. What is near, far and huge pointers? How many bytes are occupied by
them?
near uses 4 bytes, far uses 2 bytes, and huge uses 1 byte

5. How would you obtain segment and offset addresses from a far
address of a memory location?
segment is pointer/2, offset is pointer + 64K

6. What are bit fields? What is the use of bit fields in a Structure
declaration?
bit fields are arrays of integers
7. To which numbering system can the binary number 1101100100111100 be
easily converted to?
floating point
8. Which bit wise operator is suitable for checking whether a
particular bit is on or off?
the OR operator
9. How can you increase the size of a dynamically allocated array?
with strcat
10. When reallocating memory if any other pointers point into the same
piece of memory do you have to readjust these other pointers or do
they get readjusted automatically?
automatically
11. What is object file? How can you access object file?
Object file is inherited from the FILE class
12. What do the functions atoi(), itoa() and gcvt() do?
atoi: converts integer to ascii
itoa: the inverse, converts ascii to text
gcvt converts unsigned short to unsigned long
bye,



Yes, and I hope you do not ever come again


jacob navia <ja*********@jacob.remcomp.fr> scribbled the following:

"ROSY" <de**************@rediffmail.com> wrote in message
news:73**************************@posting.google.c om...

hello experts plz answer following questions::: thanks in advance. Yes, sure. Here, I did your assignment for you


1. Out of fgets() and gets() which function is safe to use and why?


gets



(snip)

Well done, jacob! I like those answers!

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"My absolute aspect is probably..."
- Mato Valtonen


这篇关于很多关于C的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆