473,387 Members | 3,750 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,387 software developers and data experts.

explain me all the below terms

Explain why the following fragments of code in main() of your applications cause error. Use no more than 50 words in each case.
a. gen_entity item;
b. gen_entity *gptr;
gptr = (gen*)malloc(sizeof(gen_entity));
c. gen_entity * gptr;
gptr->ID = 1234;
d. gen_entity * gptr;
gptr = gen_create();
...
if (gptr->ID > 5) {
...
}
Aug 30 '07 #1
2 1254
JosAH
11,448 Expert 8TB
Is this yet another quiz? What can we win? What do *you* think the answers are;
we are not going to work out your homework you know.

kind regards,

Jos
Aug 30 '07 #2
kreagan
153 100+
Explain why the following fragments of code in main() of your applications cause error. Use no more than 50 words in each case.
a. gen_entity item;
b. gen_entity *gptr;
gptr = (gen*)malloc(sizeof(gen_entity));
c. gen_entity * gptr;
gptr->ID = 1234;
d. gen_entity * gptr;
gptr = gen_create();
...
if (gptr->ID > 5) {
...
}
a.) items are objects and entity should be entities
b.) pointers are an abstract idea and not entity. It's Murloc, not malloc.
c.) 1234 is too easy, it should be more complicated. Try encrypting it.
d.) generation X has created anything useful. Try gen_y_create();

Hope that helps.
Aug 30 '07 #3

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

Similar topics

14
by: bo | last post by:
And why and where one should use one vs. the other? Verbally, it seems like semantics to me--but obviously there is some actual difference that makes references different and or preferable over...
5
by: J Allen Horner | last post by:
I'm just starting to learn C, and the tutorial I'm reading uses this code as an example: ----------- #include <stdio.h> #define MAX 10 int a; int rand_seed=10;
0
by: Alan Silver | last post by:
Hello, Sorry for the long post, but I want to try and explain it clearly... I'm using webparts for (possibly) an unusual scenario, and I'm having problems. This could be because I'm doing...
5
by: Jon Lapham | last post by:
I have been using the EXPLAIN ANALYZE command to debug some performance bottlenecks in my database. In doing so, I have found an oddity (to me anyway). The "19ms" total runtime reported below...
3
by: wesley.hall | last post by:
Hello, I have worked with XML fairly extensively but have generally used DTDs to describe the structure of my documents. Recently I decided to try to pick up XML Schemas and have been following...
2
by: Cylix | last post by:
In my site, There will be some word shold have explaination. The explaination will be shown in a layer(<div>). How can I add only a JS file to set all the word in every document? Is it using...
1
by: td0g03 | last post by:
Hello, I am new to C and I am new to English. I not sure what palindromes mean. I don't know exactly what my teacher wants me to do. If someone could explain it to me in a different way that would be...
1
by: egrill | last post by:
Everytime, I run this query I get 3 or 4 duplicate records. I can't figure out what is going on. Any help would be appreciated. Thanks SELECT dbo.INVOICES.ORDER_NO AS "ORDER_NO",...
1
by: kkshansid | last post by:
hi to all, i know about client ,server model but plz explain the terms anticlient, antiserver,client,server model
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.