jephthah 1,888 Posting Maven

is this one of the universities that forces their students to program in Turbo C++?

jephthah 1,888 Posting Maven

point. so i mean, does it do it print that end message twice, from the parent and the child? or just once? (or none?)

i don't have the answer, i'm just trying to narrow down possibilities.

jephthah 1,888 Posting Maven

for all daniweb here hows your day today are you ok or not?

no i'm not ok.

what should i do?

jephthah 1,888 Posting Maven

where is this template coming from? are we turning into a singles website?

jephthah 1,888 Posting Maven

IrfanView is an extremely popular freeware image manipulation tool. (but not open source, my mistake)

i particularly love it because it has a really great command line interface and non-lossy JPG rotation. it's really good for calling in your own applications. if you do any image manipulation, especially in a batch mode, this is a must-have

anyhow, you have the same name as the developer. that is all. :)


.

jephthah 1,888 Posting Maven

I have a sneaky suspicion that, after a posting or two, everyone would know it was you ;-)

aw, that's the nicest thing anyone's ever said!

:$

jephthah 1,888 Posting Maven

i thought it was more fun to use it as an example of why we need to close threads after "x" number of months of inactivity.

jephthah 1,888 Posting Maven

does it print "program done" and return 0?

jephthah 1,888 Posting Maven

Narue, you are amazing.

you think that's good, stick around.... she comes up with real some stunners.

jephthah 1,888 Posting Maven

okay. thanks.

jephthah 1,888 Posting Maven

so, what's your point?

trying to drum up business for your fledgling website? or just to get a few more hits on your google ads?

jephthah 1,888 Posting Maven

http://www.acm.uiuc.edu/webmonkeys/book/c_guide/index.html
http://www.cplusplus.com/reference/clibrary/


as you can see, atof() is part of the <stdlib.h>.

in C++ this library is called <cstdlib>


This is easily found with a minimum amount googling. its not that we dont want to help, but there's a sort of a minumum level of competence assumed that people can do basic things on their own.


.

jephthah 1,888 Posting Maven

i thought this thread was about ACT-UP

jephthah 1,888 Posting Maven

then you need to set your compiler to be more strict with the warnings.

jephthah 1,888 Posting Maven

ok i'll use another way to program it even if he did not discuss it like the stdlib.h

<stdio.h> which you already use, is the STanDard Input and Output library header. it's a "standard", you see....

<stdlib.h> is the STanDard LIBrary. it's also "standard". Its the default library for darn near every C program in the world. So don't be scared. the fact that your professor is withholding it from you like it's some big secret, is even more evidence suggesting his incompetence.

<conio.h> is CONsole Input and Output. It's not standard, it's obsolete. you avoid it like the plague. or don't, and get the plague. doesn't matter to me, i won't ever have to work with you.

is there any site u recommend to download Turbo C that is safe, without any virus? please.
thanks. God bless the wise!

no, i refuse to do so on the grounds that it will violate my principles. and god forbid you go find it yourself.

jephthah 1,888 Posting Maven

unix/linux represents a newline character ('\n') as 0x0A, called a LF (line feed) and windows represents a newline character ('\n') as 0x0D 0x0A called a CR LF (carriage return line feed). your professor's file is the unix case.

if, when writing programs in unix, you want your newlines to look like windows newlines, you can write them as '\r\n' to give the CR LF. be careful running this on windows, becasue it will give you CR CR LF (0x0D 0x0D 0x0A)..... and let's not even get started on Macs.

this whole incompatibility issue is historic, and there's a huge explanation about the whys and wherefores if you care to read about it. most text editors can deal with the various formats. Windows Notepad can not. So just be aware of this fact. I avoid using Notepad.

be advised, this whole issue can be a pain in the ass if you let it. just understand and accept the way it is, and don't stress about it.


.

jephthah 1,888 Posting Maven

Second, what teacher is going to go to a forum to hear random people whine and flame?

because.... they have so much free time on their hands, since they're not researching new teaching methods or current industry trends?

eh, yeah ... okay ... i got nothing.

jephthah 1,888 Posting Maven

well, is SURE IS A GOOD THING we keep threads open indefinitely.

because if we closed them after a period of inactivity, we'd miss gems like this.

jephthah 1,888 Posting Maven

you'll probably get better responses if you post your C++ code in the C++ forum.

jephthah 1,888 Posting Maven

this is a classic error. the macro just replaces the code in the program with your #define'd value verbatim. therefore, it's calculating according to the order of operation: 225 / 15 * 15 , which is 225.

change your #define to

#define SQR(x)     (x * x)

.

jephthah 1,888 Posting Maven

We used Turbo C in our programming and we need to do our project using Turbo C only.

That's a lie. Your instructor is an incompetent dolt. If he says otherwise, send him here.

Do everyone a favor, especially yourself, and use a modern development environment such as code::blocks with the MinGW compiler.

anything you build using a modern compiler that complies with the C standard (such as the link above) , will work on your instructor's retarded choice of a 20-year-old dried turd of a compiler. the reverse is NOT true, however, so don't waste your time building garbage on a decrepit toy.

do it right.


.

Aia commented: For a neverending anti-turbo-c campaign. +8
jonsca commented: "Beautiful" imagery +3
jephthah 1,888 Posting Maven

there's no reason why you should be afraid of <stdlib.h>. it won't bite you. you should not use <conio.h> that library has been obsolete for 20 years. most modern compilers do not use it.

as to "how to randomize", here's the simple answer: if you want a random number from 1 to 'n',

int number;
number = rand() % n + 1;

there some are problems with this method, but you don't need to worry about them for now.

one thing, this will generate the same sequence of "random" numbers each time you run the program. if you want a different sequence of random numbers each time the program is run, you'll need to "seed" the number generator, using "srand"

jephthah 1,888 Posting Maven

const means constant.

that it won't be changed anywhere within the scope where it is implemented.

if a function takes, for example, a pointer to a "const char" argument, you know you can pass in a string to that argument and your string will not be modified by the function.

jephthah 1,888 Posting Maven

I am give you algorithm to find the factorial of given no. Try your self.
1. Intialize variable no,fact=1,ans
2. Get value of no from user.
3. Do while(no>=fact)
4. Take answer in ans variable
5. Display ans

huh?? what does this most incoherent mess of pseudo-code mean? this is garbage.

jephthah 1,888 Posting Maven

wow, i could change my name and my picture and i would be like a completely new person that no one would know who i am!

jephthah 1,888 Posting Maven

well, don't everyone start pushing at once.

cause tonight we're gonna party like it's 1999.

jephthah 1,888 Posting Maven

can i change my name, too?

jephthah 1,888 Posting Maven

welcome!

im sure you've found the Java forum already, it's quite an active place.

good luck in your studies!

jephthah 1,888 Posting Maven

welcome. sounds like you're in for a lot of work. VB and C# all at the same time. personally, i'd drop the VB class and pick up something more useful, like Classic Hellenic Literature, but hey that's me :)

jephthah 1,888 Posting Maven

finally joined, huh? well, what took you so long? :)

welcome!

jephthah 1,888 Posting Maven

welcome. i think you'll do well. i see you've already found the place where you add links to your signature.

jephthah 1,888 Posting Maven

great plan! welcome have fun and learn. stay long enough you just may move on to helping others, too

jephthah 1,888 Posting Maven

welcome!

a certificate is better than no certificate, and can easily be what gets you the job rather than someone else. many jobs require it as a minimum, anyhow.

good luck, holla in the forums for advice.

jephthah 1,888 Posting Maven

welcome! i vaguely remember the days of 300 baud. and programs on magnetic tape.

jephthah 1,888 Posting Maven

welcome to daniweb, mark

jephthah 1,888 Posting Maven

welcome Irfan.

do you know that you have a famous name for open source graphics development.

jephthah 1,888 Posting Maven

you're in the right place so ask away! in the proper forum, of course :)

jephthah 1,888 Posting Maven

welcome

jephthah 1,888 Posting Maven

welcome to match dot com

jephthah 1,888 Posting Maven

Write a C program to find the factorial of a number using do while loop?

well, yes. yes, i can. thank you! :)

jephthah 1,888 Posting Maven

i never understood it either, as the more obscure commands in the C pre-processor are beyond the scope of my typical work.

that said, a good overview of the C pre-processor and descriptions of all the commands in the processing language can be found at http://gcc.gnu.org/onlinedocs/cpp/index.html#Top .. line control has its own section

jephthah 1,888 Posting Maven

@urbangeek :

1) don't post full code solutions to poster's questions.

2) DEFINITELY dont post broken code to a poster's question

3) if you've got problems, take them to a new thread of your own creatioon. Don't confuse a poster by cluttering up their question with your problems.

in short, if you don't know what you're doing, stop helping. ask and learn all you want in your own threads.

jephthah 1,888 Posting Maven

redtube

oh, wait. what?

jephthah 1,888 Posting Maven

we'll be a couple rockin' dudes, then.

jephthah 1,888 Posting Maven

ch- ch- check it out now

jephthah 1,888 Posting Maven

when i was a child, i used to watch the re-runs of a US sitcom called "Laverne and Shirley".

it was about these two women who were roomates and coworkers at a beer-bottling plant, and their antics and adventures with their bluecollar friends in their urban Milwaukee neighborhood. Laverne was the dominant personality, Shirley still slept with her childhood stuffed animal named "Boo Boo Kitty."

So anyhow, in the beginning of every show, the theme song would play while showing comic clips from various episodes. There was always this one scene I really enjoyed, where Laverne put one of Shirley's work gloves on the bottling conveyor line and Shirley was first upset, but then became resigned as she realized there was nothing she could do but watch it disappear into the distance. More on this in a moment.

Now the one thing that always confused me was this little chant that started the lyrics to the theme song it went something like this:

Shlmeel, Shlmazel, Fasenfeffer incorporated.

Now i never knew what the hell any that meant. What's a shlmeel? What's a shlmazel? What on earth is a Fassenfeffer? My mom didnt know either. We sheepishly suggested they maybe weren't even real words, but we were thinking that surely it was our knowledge that is at fault, because SOMEBODY knows what those words meant, SOMEWHERE.

Now I'm considering your functions, "shmat" and "shmget", and once again I'm asking "what the hell is this?" The old …

jonsca commented: Reminiscence Rep +3
WaltP commented: But not helpful. -2
Ancient Dragon commented: wtf??? -5
jephthah 1,888 Posting Maven

well, the main problem is, your math doesn't make any sense, at least not to any conventional system of grading percentages. but let's try and fix this as best we can...

percentage=(marks/1100)*100;

besides begging the obvious question "why are you doing this?" .... even if this is really what you want to do, it won't work right. Let's start with the part that doesn't work:

(marks/1100), both parts of this are integers. assuming your "marks" is a percentage value of roughly 100 or less, this equation will always evaluate as zero. How so? Okay, say marks=100. 100/1100 = 0. Because they're evaluated as "int". Division of integers always drops any fractional part, and only looks at the whole number. the rest of the equation is now meaningless, because 0 * 100 is still zero. your "percentage" of 0 is converted (correctly) as "F"

when you divide integers in an equation that needs to be evaluated as a float, you need to cast the integer as a float. so, to be evaluated properly, your equation would look like this:

percentage=((float)marks/1100)*100;

Now it "works", but it still doesnt make sense. Using the same example, marks=100, this now evaluates as (float)marks/1100 = 0.0909 . you can muliply this by the rest of the equation, so that you get a non-zero answer. 0.0909 * 100 = 9.0909. well, guess what, 9.09 is still an "F" ... that's why im saying your entire equation doesn't make sense.

jephthah 1,888 Posting Maven

welcome. hope you find what you need. go holler in the forum(s) of your choice, im sure you'll find a lot to keep busy with if you want it.

jephthah 1,888 Posting Maven

well.... rock on!

jephthah 1,888 Posting Maven

hey, three posts, and one solved thread... keep that ratio up and you'll be a star!