Compressing an array of integers in C using zlib [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I need an urgent help about compressing an array of integers using zlib,and that will be in c language.
i have: uint16_t arrayOfData[120] and i want to compress it so that i get the compressed version and use it in the same program (i don't want to read from and write to streams).
please i am waiting for any help, if sample code is available it will be great!
Thanks in advance

There is an example at http://zlib.net/zlib_how.html .

Related

How to store value of a variable in c after closing [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am doing a project on railway reservation system, my program is working fine, but when I close the program and then again start booking tickets,seat no again takes the previous value, I'm doing the project in c.
You'll need to write all of the data to a file before the program closes, and then read the data from the file when the program starts again.
That's right.

C programming - loop [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Hello I am starting to learn programming and I would like to know this if someone could help me out.
If we know how many times will loop be done whats the easiest one to use?
You should use as a rule of thumb.
If know iterations --> for
If unknown iterations --> while
If at least one iteration (but not known) --> repeat

How to implement the printf function in risc-v? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Here's the C representation of what I'm trying to do in RISC-V assembly:
printf ("x=%d\n", x);
https://godbolt.org/ is an interesting site. If you paste in c code, it can be transfered into others, such as RISC-V assembly. The sample c code is available from menie.org/georges/embedded/small_printf_source_code.html. It does work. Good luck.
Here is a very simple printf (actually only integers and strings and no advanced formatting)
https://godbolt.org/z/sgMVs7
It is not my code - it is tiny ptinf from the atolic studio. But it is a good base to implement something simple but more decent.

C: recognize variable type [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm learning C. I wonder whether there is an instruction or command to recognize the type of the variable.
To be more practical: I have a program which works with integers, I want to show an error message if the user inserts a real number when running the program.
Hope you can help!
This is not part of the C standard, but GCC has the typeof keyword.
You have to be using the GCC compiler for it though.

is it possible recover all codes from so(Shared Object) file? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am really curious that it is possible to recover all codes from so(Shared Object) file.
I made libxxx.so with 2 C files and 2 C header files.
And I removed original files except libxxx.so.
Can I remake those original files from this so file?
I want to know is it possible.
Then How? give me some clues.
Thanks.
You can get certain things back such as method names, and number of arguments from those variables, but no, you cannot decompile a binary .so file back to its original source.

Resources