473,396 Members | 1,832 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,396 software developers and data experts.

Programming Forum

Hello Guys,
I've developed a forum for programmers and shareware developers to
discuss projects, sales, promotion and more. Please take a look if you
will at http://forum.codecall.net

Thanks,
Jordan

Jun 12 '06 #1
1 2112
On 12 Jun 2006 09:01:09 -0700, jd*******@ionicware.com wrote in
comp.lang.c++:
Hello Guys,
I've developed a forum for programmers and shareware developers to
discuss projects, sales, promotion and more. Please take a look if you
will at http://xxxxx.xxxxxxxx.xxx
Utter and absolute garbage.

Example from
http://xxxxx.xxxxxxxx.xxx/c-c/201-ca...program-c.html, pasted
with "> " quotes, even though it was not part of the OP's post:

================ #include
Obviously somebody does not know how to convert header names to show
up properly in HTML.
float add(float,float);
float sub(float,float);
float product(float,float);
float divide(float,float);
void main()
Oops, undefined behavior in C, an ill-formed program in C++.
{
float n1,n2;
char sym,choice;
printf("This Program is a program for calculator\n\n");
scanf("%f%c%f",&n1,&sym,&n2);
Doesn't actually prompt for input, nor explain the expected format of
that input. Doesn't take into account the poor behavior of scanf()
with live user input, let alone the potential undefined behavior.
if(sym=='+')
printf("\n%f",add(n1,n2));
if(sym=='-')
printf("\n%f",sub(n1,n2));
if(sym=='*')
printf("\n%f",product(n1,n2));
if(sym=='/')
printf("%f",divide(n1,n2));
printf("\nDo you wish to continue[y/n]");
scanf("%s",&choice);
Uses "%s" conversion specifier to scanf() with the address of a single
character, guaranteed memory overwrite and undefined behavior.
if(choice=='y'||choice=='Y')
main();
Calls main() recursively to loop?!? Yikes!?!
}
float add(float m1,float m2)
{
return(m1+m2);
}
float sub(float m1,float m2)
{
return(m1-m2);
}
float product(float m1,float m2)
{
return(m1*m2);
}
float divide(float m1,float m2)
{
return(m1/m2);
}


The output may not appear without a terminating '\n', and the leading
'\n' is of questionable utility.

What a waste of web space.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jun 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jst | last post by:
Do you need programming help? If so, pop along to our new forum and post your questions to our qualified developers. http://forum.elistarcreations.com
42
by: Kevin Spencer | last post by:
Is it just me, or am I really observing a trend away from analysis and probem-solving amongst programmers? Let me be more specific: It seems that every day, in greater numbers, people are coming...
1
by: jdelozier | last post by:
I just wanted to let you know that there is a new programming forum available for anyone to join, get answers or get answers. Please take a minute to check out the forum. http://www.codecall.net...
4
by: Maciek | last post by:
I've got this question regarding programming and design practices. I'm designing Newsletter module for my WebApp and I'm greenhorn in programming. There's a stored procedure which adds a...
17
Banfa
by: Banfa | last post by:
I felt that this was a good point to start a tutorial on C/C++ programming because clearly we need to have some idea of what we are trying to achieve before we start out. I recently found this...
2
by: technica | last post by:
Hello All, We have started with a new programming discussion group on Gmail. TechnicalTalk is a group dedicated to computer programming discussion, programming tutorials, programming articles...
0
by: technica | last post by:
Visit http://www.TechnicalTalk.net for free resources Technical Discussion Forum General computer programming languages, application programming, programming tutorial and technical articles...
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:
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.