C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 17th, 2009, 10:51 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Trouble ending loop

I'm having trouble ending a loop that is call a multiplication function.

I want to repeat then end when I decide to end it, instead of doing a for loop

When I took a C class (over a year ago now), we used an EOF but I don't have my old work with me to look it up.

I tried using setting bool up and it works, until I type something other than 1 or 0. And I can't find a solution to stop anything other than 1 or 0 from being entered.

I'd like to not have to be asked for another problem to appear, and be able to end the program whenever.

Here's my code. If you have any tips on my function I'm very open to suggestions to make it better. Just trying to learn in my spare time. As of now the function works properly so I'm not spending anytime improving it.

Code:
#include <iostream>
#include <math.h>
using namespace std;

int multiply()
    {
              srand( time(NULL));
              int a;
              int i = rand() % 10;
              int j = rand() % 10;
              int b=i*j;
                  
                  cout<<""<<i<<"x"<<""<<j<<"=";
                  cin>>a;

                  if(a==b){
                           cout<<"That is correct!"<<endl;
                           }//end if
                  while(a!=b){
                              cout<<"Try again!"<<endl;
                              cout<<""<<i<<"x"<<""<<j<<"=";
                              cin>>a;
                                 if(a==b){
                                          cout<<"That is correct!"<<endl;
                                          }//end if
                              }//end while
}//end multiply function

//begin main to call multiply
int main()
{
    bool x=true;
    
    while(x!=false){
                    cout<<"Type 0 to exit, or 1 to continue: ";
                    cin>>x;
  
                            multiply();
      
                  }//end while
    
    system("pause");
    return 0;
}//end main


Thanks in advance to anyone who can give me a hint at what to do.

Reply With Quote
  #2  
Old June 17th, 2009, 11:27 AM
salem's Avatar
salem salem is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2005
Posts: 2,140 salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 1 Month 2 Weeks 1 Day 23 h 44 m 15 sec
Reputation Power: 861
To begin with, better indentation would be a good move.
It's less than 50 lines, and already it's much harder to read than it needs to be.

Follow the //!! comments for more ideas
Code:
#include <iostream>
#include <cmath>  //!! was math.h
using namespace std;

int multiply()
{
  srand( time(NULL)); //!! you should do this just ONCE in main().
      //!! if this were in a loop, you'd really notice the non-randomness
  int a;
  int i = rand() % 10;
  int j = rand() % 10;
  int b=i*j;
  
  cout<<""<<i<<"x"<<""<<j<<"=";
  cin>>a;

  if(a==b){
    cout<<"That is correct!"<<endl;
  }//end if
  while(a!=b){
    cout<<"Try again!"<<endl;
    cout<<""<<i<<"x"<<""<<j<<"=";
    cin>>a;
    if(a==b){
      cout<<"That is correct!"<<endl;
    }//end if
  }//end while
}//end multiply function

//begin main to call multiply
int main()
{
  bool x=true;
  
  while(x!=false){
    cout<<"Type 0 to exit, or 1 to continue: ";
    cin>>x;
    if ( cin.fail() ) {
      //!! do something here
    }
    multiply();
    
  }//end while
  
  system("pause");
  return 0;
}//end main
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Reply With Quote
  #3  
Old June 17th, 2009, 11:31 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Quote:
Originally Posted by salem
To begin with, better indentation would be a good move.
It's less than 50 lines, and already it's much harder to read than it needs to be.

Follow the //!! comments for more ideas
Code:
#include <iostream>
#include <cmath>  //!! was math.h
using namespace std;

int multiply()
{
  srand( time(NULL)); //!! you should do this just ONCE in main().
      //!! if this were in a loop, you'd really notice the non-randomness
  int a;
  int i = rand() % 10;
  int j = rand() % 10;
  int b=i*j;
  
  cout<<""<<i<<"x"<<""<<j<<"=";
  cin>>a;

  if(a==b){
    cout<<"That is correct!"<<endl;
  }//end if
  while(a!=b){
    cout<<"Try again!"<<endl;
    cout<<""<<i<<"x"<<""<<j<<"=";
    cin>>a;
    if(a==b){
      cout<<"That is correct!"<<endl;
    }//end if
  }//end while
}//end multiply function

//begin main to call multiply
int main()
{
  bool x=true;
  
  while(x!=false){
    cout<<"Type 0 to exit, or 1 to continue: ";
    cin>>x;
    if ( cin.fail() ) {
      //!! do something here
    }
    multiply();
    
  }//end while
  
  system("pause");
  return 0;
}//end main


Thank you very much. I was planning on using cmath originally, but couldn't remember if it was just math or cmath.

and I will move srand to main as well.

Reply With Quote
  #4  
Old June 17th, 2009, 12:44 PM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 3,749 clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 6 h 24 m 13 sec
Reputation Power: 1167
Quote:
Originally Posted by ihut
I was planning on using cmath originally, but couldn't remember if it was just math or cmath.
But why!? Nothing in your code requires anything in <cmath> in any case.

rand() and srand() are declared in <cstdlib>/<stdlib.h> which you did not include. It worked more by luck than judgement because presumably in your specific compiler's library, cstdlib is included by one of the other headers you used, but that is not a given for any compiler.

Don't unnecessarily re-quote entire posts - it is already there for us to see.

Reply With Quote
  #5  
Old June 18th, 2009, 10:22 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
I took out math.h after my last post yesterday, because I realized I didn't need it.

I don't know all the libraries and what's inside of them by heart, so forgive me for doing something by mistake. I have to learn somehow.

Also, if I remember right, most of stdlib.h is covered by iostream. That's why system("pause") works without stdlib.h at least.

Reply With Quote
  #6  
Old June 18th, 2009, 11:59 AM
Lux Perpetua Lux Perpetua is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: San Francisco Bay
Posts: 1,697 Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level)Lux Perpetua User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 19 h 28 m 25 sec
Reputation Power: 928
Quote:
Originally Posted by ihut
Also, if I remember right, most of stdlib.h is covered by iostream. That's why system("pause") works without stdlib.h at least.
Is this really true? There's a difference between truly correct, portable code and code a compiler accepts. The compiler might implement extensions of the standard, or it might just be ignorant or lazy.

Reply With Quote
  #7  
Old June 18th, 2009, 12:04 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 8,354 Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 17 h 44 m 34 sec
Reputation Power: 2549
Quote:
Originally Posted by ihut
Also, if I remember right, most of stdlib.h is covered by iostream. That's why system("pause") works without stdlib.h at least.

Maybe on your compiler alone. It is not necessarily portable, so it may not work on another compiler. By the way, you should really include <cstdlib> instead of stdlib.h, since you're going the C++ way .

Including it twice won't cost anything. C++ include files have header guards something like this:
Code:
#ifndef CSTDLIB_H
#define CSTDLIB_H

... rest of stuff
#endif

Thus including the file multiple times won't matter, because the preprocessor will only grab one copy anyway because of the include guards
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Fishmonger, superior perl programmer of the month

Reply With Quote
  #8  
Old June 19th, 2009, 09:58 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Thumbs up

Ok. I thought it may have been a universal thing. My teacher wasn't very good when I took c and c++ and we really didn't cover much. So I don't have a lot of great information on different compilers and what not.

I've been using bloodshed's Dev-C++, and it's always worked. From now on I will include either <stdlib.h> or <cstdlib>. Thanks for the info.

Reply With Quote
  #9  
Old June 22nd, 2009, 11:19 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Have it working the way I wanted it to now

Thanks for all the help. If anyone sees an area to improve on please let me know as I am going to be building off of this to slowly make a math tutoring program for simple math (starting with questions and answers, maybe moving on to explanations.)

Code:
#include <iostream>
#include <cstdlib>
using namespace std;

int add()
{
    int a;
    int i = rand() % 9;
    int j = rand() % 9;
    int b=i+j;
                  
    cout<<""<<i<<"+"<<""<<j<<"=";
    cin>>a;
    
    if(a!=b){
      cout<<"Try again!"<<endl;
      cout<<""<<i<<"+"<<""<<j<<"=";
      cin>>a;
    }//end if try again

    if(a!=b){
      cout<<"Try again!"<<endl;
      cout<<""<<i<<"+"<<""<<j<<"=";
      cin>>a;
    }//end if try again
      
    if(a==b){
      cout<<"That is correct!"<<endl<<endl;
    }//end if correct
    
    if(a!=b){
      cout<<"The correct answer is "<<b<<endl<<endl;
    }//end if answer
  
}//end addition function

//begin main to call addition
int main()
{
    srand( time(NULL));
    
    bool x=true;
    
    while(x==true){
    
      cout<<"Type 0 to exit, or 1 to continue: ";
      cin>>x;
  
      add();
      
    }//end while
    
    system("pause");
    return 0;
}//end main
          

Reply With Quote
  #10  
Old June 22nd, 2009, 01:26 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 8,354 Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 23rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 17 h 44 m 34 sec
Reputation Power: 2549
Yes, just one thing. Instead of importing everything in the std; namespace, it is better to qualify them.

That is, instead of doing this:
Code:
using namespace std;

cout << "Hello world\n";
cin >> foo;


it is better to do this:
Code:
// using namespace std; <-- Notice we commented out this line
std::cout << "Hello world\n";
std::cin >> foo;


or if you don't feel like typing std:: in front of each of your standard objects, at least qualify only specific objects instead of everything in your std:: namespace.
Code:
using namespace std::cout;
using namespace std::cin;

cout << "Hello world\n";
cin >> foo;


The whole purpose of namespaces is to prevent name conflicts. By using namespace std; you're negating the entire reason for namespaces.

See http://www.parashift.com/c++-faq-li...s.html#faq-27.5 for more.

Reply With Quote
  #11  
Old June 25th, 2009, 10:17 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Ok thank you very much for the info. I never really understood the difference, but that makes sense.

Reply With Quote
  #12  
Old June 26th, 2009, 04:40 AM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 3,749 clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 6 h 24 m 13 sec
Reputation Power: 1167
Quote:
Originally Posted by ihut
Also, if I remember right, most of stdlib.h is covered by iostream. That's why system("pause") works without stdlib.h at least.
I guess that you either did not read or did not understand my comment on this. A particular header may or may not include another. It is not a requirement that <iostream> be implemented using <cstdlib>, and in many compilers it does not. Just because yours does does not make your code correct; just 'lucky'. That is to say your code works by luck not judgement.

It is very straightforward; if you use a function or class, include its header; even if it may be included indirectly in some other way. The point about indirect inclusion is that under code maintenance or porting to a different platform or compiler, such inclusion may not always hold. If you don't know what header a function or class belongs to, look it up in an appropriate reference. Good references include http://www.cppreference.com and http://cplusplus.com/reference/. You don't need an exhaustive knowledge of the standard library in your head to use it effectively. You can get a general overview of its capabilities in a couple of hours. You will then be able to apply it appropriately more often, using the references for the detail.


Quote:
Originally Posted by ihut
I've been using bloodshed's Dev-C++, and it's always worked.
That would depend on entirely which version of Dev-C++ you are using (actually it depends on what compiler you are using with Dev-C++, because it is merely and IDE not a compiler). It has been distributed with MinGW/GCC 2.95 and more recently MinGW/GCC 3.4.2, I cannot remember which, but one of these would not work as you have used it because the indirect inclusion upon which you have relied does not exist. Given its lack of maintenance since 2005, I suggest that you should stop using it in any case.

Clifford

Last edited by clifford : June 26th, 2009 at 03:57 PM. Reason: fixed bad link

Reply With Quote
  #13  
Old June 26th, 2009, 09:45 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
Ah I see. I will have to go through the libraries and see what's included where when I get a chance.

Do you have a suggestion for a better compiler by chance then? My school has always used Dev-c++.

I seem to have received a lot of bad information from my school though when it comes to programming. Another good reason for trying to go back and learn on my own.

Thanks for the information on the libraries, I appreciate it.

Reply With Quote
  #14  
Old June 26th, 2009, 04:05 PM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 3,749 clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level)clifford User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 3 Days 6 h 24 m 13 sec
Reputation Power: 1167
Quote:
Originally Posted by ihut
Do you have a suggestion for a better compiler by chance then? My school has always used Dev-c++
It was a good choice perhaps before Microsoft started giving away free tools with a working debugger (something Dev-C++ does not have - a working one that is. How you can teach C programming without teaching, and encouraging debugger usage is beyond me!). The problem is often switching course-ware may require some of the course material to be updated, so there tends to be a lot of inertia.

If you continue to use Dev-C++ at least make sure you are using version 4.9.9.2. Otherwise: http://www.microsoft.com/Express/vc/

Clifford

Reply With Quote
  #15  
Old June 29th, 2009, 10:32 AM
ihut ihut is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Posts: 41 ihut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 59 m 4 sec
Reputation Power: 1
OK sounds good. The teacher teaching c and c++ at my school is still semi stuck in the days of punch cards, so that could be her main issue.
Comments on this post
jwdonahue disagrees: If She's teaching C++ she's not stuck in the days of punch cards. She may however have more of a
computer science background than in engineering.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Trouble ending loop


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek