What does this short snippet of C code do? (see details)

1 Answer

Answer :

answer:It’s been a long time since I did much in C… but It looks like it reads a file (or url?) and assigns that reference to the variable “handle” to use later, then reads each bit or line of the file and once it’s been through the whole file closes the reference. By itself, it doesn’t do anything really except read the file and there are some variables that are defined outside the snippet you have here… (n, sizeof bits), some of these may be constants used in C. I’d guess this is a function just meant to return file contents in an expected format for use elsewhere. More of the context would provide more clues.

Related questions

Description : Mystery Javascript snippet?

Last Answer : it looks like a piece of obfuscated code. Because normally JavaScript even in it's most complex is still humanly readable. If it is not obsfucated, then someone must have some really messed up naming ... but for what little I know, it does not look like it would ever work for any browser.

Description : Is there a coldfusion equivalent to the NextGenLinks code snippet?

Last Answer : answer:Since this type of question is out of my league, here is the contact info, so you can ask the expert of Coldfusion his contact sheet even says, Please contact me with any of your questions about ... . Sounds like the guy with your answer!! http://www.bennadel.com/ask-ben/ask-ben-nadel.htm

Description : Find the output of the following Java code snippet after execution of each java statement labelled -Technology

Last Answer : The output is:IN5inin5

Description : Find output of the following Java code snippet : -Technology

Last Answer : OutputDelhi 110001 10001

Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : Answer: c Explanation: Arithmetic > operator cannot be used with dictionaries.

Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error

Last Answer : Answer: b Explanation: If d2 was initialized as d2 = d1 the answer would be true.

Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error

Last Answer : Answer: a Explanation: In can be used to check if the key is int dictionary.

Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} a) “john”, 40, 45, and “peter” b) “john” and “peter” c) 40 and 45 d) d = (40:”john”, 45:”peter”)

Last Answer : Answer: b Explanation: Dictionaries appear in the form of keys and values.

Description : How do I simply repeat a line of code 4x in Javascript?

Last Answer : something like a for loop is pretty simple, and gives you a handy counter if needed. for(var i = 0; i < 4; i++) { forward(); }

Description : Programmers: Thoughts on this AI game where you fight via code?

Last Answer : answer:Hmm. Cool, but so far I’m stuck on the tutorial with some sort of error: > Game.mothership.moveTo(1,0) undefined

Description : Do you still use spaghetti code , like QBasic?

Last Answer : talljasperman Sorry I didn’t know that spaghetti code was a pejorative. My teacher called it that and I did not look it up.

Description : I understand what the PL/SQL code below is supposed to do, but when I run the code, it won't compile. Can anybody help with why this is so?

Last Answer : answer:PL\SQL really isn’t my thing, but I believe you need something between the first IF statement and the ELSIF. What do you want it to do with the number if it is 50 or 90?

Description : How can I swap two integers without temporary variables using JavaScript code?

Last Answer : answer:This is a trick using the exclusive or operator ^ that was used when computers were short on memory. a = (a ^ b) /* a^b, b */ b = (a ^ b) /* a^b, a */ a = (a ^ b) /* b, a */ You can also do it using subtraction for numeric ... = a - b /* a - b, b */ b = b -a /* a-b, a */ a = b - a /* b, a */

Description : How does computer code break?

Last Answer : Errors in logic, programming errors with the language used; type of programming involved eg. application prgm, operating system executable, etc . operating system upgrades can be any number of items ... is alway helpful when fixing programming problems.. Albeit,a general answer, I hope it helps

Description : How to implement a JavaScript code that doing "Set as my Home Page" in Google Chrome?

Last Answer : So, you’re saying the JavaScript code for doing this works in IE and Firefox, but not Chrome? That’s weird. Let me see if I can find a script for you.

Description : Would appreciate tips on reading someone else's code and understanding it .

Last Answer : First hint: if there are no coments smack the someone else in the face with a crowbar. That said there's really not much to say, you should be able to figure out what the code says ... trying to understand what the subroutines are for and then from that wrking out why the bigger parts need them.

Description : Python Code error?

Last Answer : You have too many parens in that line—you’re passing in a tuple instead of two integers.

Description : Do I have to give up my source code to a .NET DLL I wrote?

Last Answer : It depends on the contract that you had with the client. You might want to check Free Lance Switch. It’s a community of Freelance designers/coders. They might be able to help you out more.

Description : Is there somewhere where I can have someone look at my code and give me suggestions on how to make it better?

Last Answer : There are dozens of PHP forums on the web where you can submit things like that. Just search for PHP community or PHP forum. Most web design forums and communities will have an area for programming ... own forums as well. Just post a thread showing your code and asking for whatever help you need.

Description : The OpenGL source code for an open source Breakout game?

Last Answer : Here is one Learning and copying from others code is cool. Using code is cool if credits are made.

Description : Do I have to be in U.S to be able to participate in Google's Summer of Code?

Last Answer : http://socghop.appspot.com/document/show/program/google/gsoc2009/faqs#student_eligibility

Description : What's the worst single line of code/script/command you have ever written/seen?

Last Answer : You might enjoy this story.

Description : What's some good music to code to?

Last Answer : EDIT: Panic at The Disco. Period.

Description : How much sample code should you give when asked for it as part of a programming job application?

Last Answer : answer:I've recently gone through an interview process where they did ask to see some code that I've written, but didn't ask to actually have the code sent to them. I would assume that a majority of ... you shouldn't have too much of a problem sending the code to them if they insist upon it too.

Description : Do you code on white or black?

Last Answer : I used to do it in white too, and I am definitely liking the change to black. makes my code stand out more and well it saves some battery use :P

Description : What kinda of code commenting system do you use?

Last Answer : answer: I write bad code. Seriously, that is in stuff viewable be to public. And I comment the fuck out of everything.

Description : What is the HTML code of Visit Count below Needsbd.wapkiz.com ?

Last Answer : You can find http://redowan.wapkiz.com on this website.

Description : What is Html Code to Red Text ?

Last Answer : Your writing! You can color the text using the HTML code .

Description : Want HTML code to enlarge text ?

Last Answer : HTML to enlarge text: your text or your text

Description : Enter the HTML code to color the text ?

Last Answer : + font color = "lime"> Your writing . When using the code, give + example

Description : Web site link that can copy all the code to design Wapkiz site ?

Last Answer : I am giving you the names of some sites from where you can copy the code. Site- 1 Site- 2 From these two sites you will get all the code for creating Wapkiz site . If you need more sites, please let us know in the comments.

Description : Another website design query (Details...)

Last Answer : answer:I would recommend looking in to writing scripts using jQuery. I'm currently in the process of designing a site myself and have been amazed at what can be accomplished now with just a ... here. They range from very simple beginner guides to some advanced shit that will rearrange your brain.

Description : Techie questions for web-developers/designers (details inside)

Last Answer : If your hosting service allows you to manage the .htaccess file, you can set the default page or pages in it. See http://davidwalsh.name/directory-index-homepage-htaccess

Description : Can you help me find an App that can help one make App's? (any platform, including pen and paper, details inside)

Last Answer : answer:I'm not sure if it's quite what you're looking for, but my buddy makes AppCooker. You can use it with AppTaster to create mockups and make them play. I can't speak to their efficacy personally because ... charge $75-125/hour. If that's the route you end up wanting to take, feel free to PM me.

Description : Programming/math question, please see inside (if you're a math wizard)

Last Answer : I wonder if ray-casting strategies would be appropriate here, since it’s like trying to calculate when one object eclipses another.

Description : How do I see if a Ruby symbol has already been defined?

Last Answer : Your question seems a little odd. Can you pastie the code you’re looking at with some comments?

Description : What is your favorite snippet, quote, fragment, or poem by Rumi?

Last Answer : “That hurt we embrace becomes joy. Call it to your arms where it can change.”

Description : How do i remove unnecessary buttons from a google map snippet on my blog?

Last Answer : I made a example of this for you. View the source to see how it was done. You will need to change the API key to the one for your site.

Description : Which ad extension allows you to send traffic to different pages on your website? A. Structured snippet B. Call C. Sitelink D. Callout

Last Answer : C. Sitelink

Description : Salesforce SDK uninstallation from XCode?

Last Answer : Too many variables – only you know your code, how it was written, and how extensible (or not) it was in the first place. I assume you have been to the Saleforce API and SDK pages.

Description : Is there a program where you can identify music in a specific website?

Last Answer : Need Answer

Description : What is a good programming language to make a multiple choice quiz?

Last Answer : Google classroom should work.

Description : Is there a website that shows all the English words, idioms, etc ever invented, including archaic, unofficial, and newest words that have just been invented?

Last Answer : The problem with such a lexicon would be that there have been a lot of slang, dialect, idioms, and unofficial words that 99% of people have never heard of. Besides that, the English language is ... pretty good vocabulary. Hopefully, someone will recommend some. I am unable to do this at the moment.

Description : How can I add HTML markup to this ajax result?

Last Answer : Need Answer

Description : Function or application allowing me to connect or disconnect wifi?

Last Answer : Some routers - Belkins and older Ciscos, had an app that would allow you to remotely-control your router from your phone. You didn't say what kind of router you have, so it's hard to guess. You can ... . Bottom line - you can do this easily if you have a wifi-based power switch and an app. example

Description : How can I become advanced in javascript in 2 months?

Last Answer : Study hard…work hard!!!

Description : Can you help fix this programming problem in Python?

Last Answer : You can’t treat arrays of digits as a single number. The easiest way to read a numeric string is to use the sys library to read a line from the keyboard. import sys print(“Enter value for mass”) mass = sys.stdin.readline() mass = float(mass)

Description : What's the best book for understanding Unity 2D?

Last Answer : Are you a beginner programmer in general, or just new to Unity? That would make a big difference in how I would respond.

Description : Programmers: Is this puzzle a "named problem?" and can you help me with it?

Last Answer : I'd call it enumerating a list of all combinations . There's a field of math called combinatorics which I did not study but I assume probably has a word for this. It doesn't seem like a puzzle ... each iteration, and tweak it to get the output format you want, but that's essentially it, I think.

Description : How do you get the link posted and not the updated page?

Last Answer : You don't have control over it. The URL that you referred to today is pointing to a page that is housed at a server somewhere else. It isn't under your control or Fluther's - it is under the control of ... a month or a year ago. Summary: it isn't under your control. You get the page they send you.