Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to print the string which is larger like small document but I can not store all the string because the char type range is up to 256. is there any way to display?

What I have tried:

I am new to c programming .. i don't know how to proceed.. i thought can i use structures?
Posted
Updated 28-Oct-17 4:13am
Comments
Richard MacCutchan 28-Oct-17 9:06am    
Your question is not clear, please edit your question and add some more detail.

1 solution

A string is made up of char values: it is an array of chars, normally terminated by a null character.
While each character can be only in the range of 0 to 255 inclusive (unless your embedded system implements Unicode, which seems unlikely) there is no such restriction on the size of the array - it's size is limited only by the size of an array index in your embedded system (normally 32 bit integers these days, but may be 16 bit in much older systems).

The only thing you can't do is store the length of the string (if any) in a single character - but as long as you keep that in an integer, you should be fine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900