Happy HolidaySs Giveaway - Last Sponsor Giveaway of the Year!

Come Enter the BrewDeals/FastFerment Giveaway!


Home Brew Forums > Home Brewing Community > General Chit Chat > C++ Programming help
Reply
 
LinkBack Thread Tools
Old 07-23-2008, 04:22 AM   #1
SporkD2
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2008
Location: San Antonio, Texas
Posts: 748
Liked 1 Times on 1 Posts
Likes Given: 1

Default C++ Programming help

Anyone on this board a good c++ programmer? I am currently a computer sci major and programming is hard for me to understand. I would love to have someone who I could email questions and maybe have a few chats about things that are confusing me.

Thanks

Please contact me via aim, yahoo messenger or ms3077@charter.net

__________________
SporkD2 is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 04:44 AM   #2
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,987
Liked 629 Times on 392 Posts
Likes Given: 57

Default

For your sake, I hope that your major is focused in areas other than programming (hardware, architecture, etc). My degree is in computer science, and we really focused on code/software development. C++ is a pretty simple language. What's confusing?

__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 04:47 AM   #3
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 32 Times on 17 Posts
Likes Given: 5

Default

You can pick my brain too.
One of the best books I have is Jamsas C/C++ programming bible. Highly recomend it.

__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 04:56 AM   #4
SporkD2
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jun 2008
Location: San Antonio, Texas
Posts: 748
Liked 1 Times on 1 Posts
Likes Given: 1

Default

Well my emphasis is computer networking, not programming. I have already taken the intro course and am now into the 2nd out of 3 c++ classes. Just looking for someone to answer some simple questions about the programs I have to write for when I get stuck.

For example:

I have to take a user inputted string, such as AAA765, make sure that the first three characters are uppercase (toupper) and then do a binary search from an array I have created and show a fine amount. I can do this if the user enters their license plate number as an uppercase, but if they enter lowercase, it comes back as not found.

__________________
SporkD2 is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:00 AM   #5
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,987
Liked 629 Times on 392 Posts
Likes Given: 57

Default

Ok, that sounds pretty straightforward, but some example code would make it far easier to troubleshoot.

__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:00 AM   #6
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 32 Times on 17 Posts
Likes Given: 5

Default

Can you post your code?

__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:12 AM   #7
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 32 Times on 17 Posts
Likes Given: 5

Default

Well to address the lower case issue.
I am using lplate as the input string
You can do something like

Code:
char *str=&lpate;
for (int i=0 : i
Now this is C, not C++. If you're expected to use some Class and it's methods to do this we need to know what object you are using. Or are you building the clasS?

Edit: fixed syntax
__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:34 AM   #8
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,987
Liked 629 Times on 392 Posts
Likes Given: 57

Default

Maybe this will help:

Code:
#include 
#include 
#include 

using namespace std;

void makeupper (string& s)
{
  int i = 0;
  while (s[i])
  {
    s[i] = (toupper(s[i]));
    i++;
  }
}

int main ()
{
  int i = 0;
  string str = "It's 5 o'clock somewhere!\n";
  makeupper(str);
  cout 
EDIT: Damn, Virtuous beat me to it. I like mine better.
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:39 AM   #9
CodeRage
Death by Magumba!
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
CodeRage's Avatar
Recipes 
 
Join Date: Aug 2007
Location: Melbourne, Fl
Posts: 2,254
Liked 32 Times on 17 Posts
Likes Given: 5

Default

Quote:
Originally Posted by Yuri_Rage View Post
Maybe this will help:
Code:
#include 
#include 

using namespace std;

void makeupper (string& s)
{
  int i = 0;
  while (s[i])
  {
    s[i] = (toupper(s[i]));
    i++;
  }
}

int main ()
{
  int i = 0;
  string str = "It's 5 o'clock somewhere!\n";
  makeupper(str);
  cout 
EDIT: Damn, Virtuous beat me to it. I like mine better.

You need ctype.h in there too. Cant make it too easy for him though That and I dont remember if toupper() checks if a char is a lower case alpha. Probably does
__________________
Brutus 20e build | Electrical Primer for Brewers | Auber SYL-2362A2 PID Install & Config
So as I am walking out the door this morning I think to my self:
"self, going to work on Monday is like knowing you're going to get kicked in the nuts. You just don't know when or by who"
CodeRage is offline
 
Reply With Quote Quick reply to this message
Old 07-23-2008, 05:40 AM   #10
Yuri_Rage
Gritty.
HBT_MODERATOR.png
Feedback Score: 0 reviews
 
Yuri_Rage's Avatar
Recipes 
 
Join Date: Jul 2006
Location: Southwest
Posts: 13,987
Liked 629 Times on 392 Posts
Likes Given: 57

Default

Quote:
Originally Posted by Virtuous View Post
You need ctype.h in there too.
Compiles and runs just fine.

...but it probably shouldn't. toupper() is supposed to be in ctype.h.
__________________
Homebrewed Blog..........YouTube Channel .......... Shirts, posters, etc
Yuri_Rage is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with Love TS programming GamePreserve Kegerators and Keezers 17 12-24-2009 06:00 PM
Help Programming PID Please kickflip_mj Equipment/Sanitation 5 08-13-2009 04:21 PM
Need some help programming this thing... Sherpa FE Equipment/Sanitation 10 02-10-2009 12:21 AM
My geek programming skills may be useful! pompeiisneaks Brewing Software 19 02-09-2009 07:32 PM
Computer Programming brauhaus General Chit Chat 21 08-06-2008 08:00 PM



Newest Threads

LATEST SPONSOR DEALS