iOS development bug--capacity parameters for C-language arrays

Source: Internet
Author: User

This mistake has not met before, pretty wonderful mistake, just at the beginning do not understand, because it toss for a long time.

Let's summarize briefly and have time to sort it out later:

corresponding to the creation of the C language byte array, I started with: Byte b[protocol_cache_buffer_size]; this protocol_cache_buffer_size (protocol_cache_buffer_ Size) I pull it out in some way.

The way I started with constant declarations:

In the. h file: extern int const protocol_cache_buffer_size;

In the. m file: int const PROTOCOL_CACHE_BUFFER_SIZE = 2048;

This will cause a problem with array B after byte type, that is, the stored value becomes something else.

But I changed the following way:

#define PROTOCOL_CACHE_BUFFER_SIZE 4028;

It was a wonderful situation, but I still had to toss it for hours. make my overall coding progress is very slow. This is a simple record of the essay, with time to be added later. For specific reasons, take time to explore it later.

Add some of the following:

And fill in this part of the code: Link: http://pan.baidu.com/s/1i5tqW3j Password: 3w8e < warm hint: This password is encrypted, oh, the simple change of the number, of course, is to not open, Hee >

iOS development bug--capacity parameters for C-language arrays

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.