473,394 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

help needed on C program exection

Hi ,

Can any one calrify me giving answers to the questions based on the c program given below.
Expand|Select|Wrap|Line Numbers
  1. char * b, q, *r;
  2. b=getbuf();
  3. q = *b;
  4. r= anotherfunction(b);
  5. /* we want to use ‘q’ and  ‘r’ here*/
  6. char * getbuf()
  7. {
  8.    char buff[8];
  9. /* unspecified, buff defined here *./
  10.   return (char *) buff;
  11. }
  12.  
1. What will be in variable ‘q’ after line q=*b is executed? Under what conditions might this not be so?



2. Is there an alternative, but equivalent, way to write the line char * getbuf() If so, what is it?



3. Is getbuf() a reasonable function?



4. Will getbuf() execute at all?



5. Please comment on line return (char *) buff;



6. Is getbuf() good practice, and why?



7. What line not given should be provided for compilation?

Please I need help very urgently .

Regards
Sahitya
Nov 15 '07 #1
1 1102
sicarie
4,677 Expert Mod 4TB
What did you get when you ran this yourself?
Nov 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
2
by: Gungmas | last post by:
When I trace the exection in my program the source code does not correspond to where the code is supposed to execute. When I single step the marker stops on empty lines or rows of comment also so...
28
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is supposed to figure out which handlers to invoke when...
4
by: Gary | last post by:
Hi, I have a temperature conversion program down pat, but I was told to add an average, meaning, i need to get the average temperature for as many times as it was entered. i do not know where to...
4
by: perryschon | last post by:
Can someone please help me out with the Visual Basic source code needed that allows configuration and usage of comm ports in any PC? I am constructing an asynchronous serial communication RS-232...
9
by: smartbei | last post by:
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with...
2
by: mia23 | last post by:
Hello, I am a java beginner and I need series help in solving this program; my assignment is due after 2 days and I can't understand this program . This is THE PROGRAM:  The ABC medical clinic...
0
by: boyindie86 | last post by:
Hi Forum, I am having some really iritating problems with an simple input page which should pass parameters into a stored procedure from the text boxes first and last name. I keep getting the...
1
by: boyindie86 | last post by:
Hi Forum, I am having some really iritating problems with an simple input page which should pass parameters into a stored procedure from the text boxes first and last name. I keep getting the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.