Beginners - October 2014 (Page 21)

Global to local variables
 
Hey so how hard would it be to convert this code to have no global variables. I found out that my professor will not accept it if it has global. Also how would ...
[2 replies] Last: Not allowed to use array's haven't learn them yet (by Gingerbread)
Inheritance question
 
Hey guys, This week in my CS class I'm learning about inheritance. We are asked draw 3 UML diagrams (one base, and 2 sub-classes). Let's say the base clas...
[3 replies] Last: No problem =) (by crimsonzero2)
Dynamic Array "Resizing"
 
I have to write a program where the user will input integer numbers. How many numbers they enter is unknown, therefor you should use a repetition structure for ...
[6 replies] Last: Your resize function looks correct to me but the main loop isn't right... (by dhayden)
Learning functions and need some help...
 
Hello. I am getting into functions in my computer science class and have an assignment that requires one. I sort of understand them, but obviously not TOO well....
[4 replies] Last: You don't have to initialize payRate, consultTime or totalIncome they ... (by mobotus)
Large Numbers show up as negatives.
 
Hello, this is my first post on this forum so I'll tell you a little about myself first. I am pretty new to programming, as im sure you can tell by the sample ...
[4 replies] Last: I havent even gotten to making preventative code for numbers less than... (by popsaregood230)
My code will compile, but it says I have not initialized my variables
 
As I said in the header this code will compile, yet it puts out erroneous results, and says the "wholesale" & "MarkUp" variables are not initialized. The output...
[2 replies] Last: Also on line 9 when you declare your function prototype, you don't giv... (by MrGoat)
Trying to Search a Character Array for a word.
 
Hello,I'm trying to create a function that will accept a character array that the user enters a word or phrase that they want to find in another array that has ...
[1 reply] : This might help: http://www.cplusplus.com/reference/cstring/strcmp/ ... (by closed account 48T7M4Gy)
by Sh0es
Getting chars from cin.
 
I'm trying to extract characters from a file in a project I'm working on. The only problem is that there doesn't seem to be any method in ifstream (or istream f...
[1 reply] : You can use the cin.get() function, with the exception of doing it lik... (by crimsonzero2)
Really need help on finding length in text file.
 
1. Find the largest word on the list, print it, and print it's length (the str.length() function will help here!). 2. Find all of the words with one letter a...
[2 replies] Last: Well, thanks but the way you do is completely different then what I ha... (by justtale)
Accessing members of another class
 
Hello. I am trying to write a function (setxy in class A) in one class to access members (function sety in class B) of another class. I am not sure what is wron...
[3 replies] Last: Thanks a lot. It works now. I've spent hours on this stupid mistake. (by carlossentino)
How to change the size of an array based on input?
 
I'm wondering what the easiest way to shorten an array based on user input would be? My program allows for a maximum of 140 characters to be entered into the a...
[11 replies] Last: Wow, so I figured out that my problem was in a different part of my co... (by Ascendant78)
by mjpin1
Guessing game code won't work
 
I am very new at programming and i am trying to make a guessing game. They are to guess a number between 1 and 1000, and if it is too low, then i ask them to t...
[11 replies] Last: Okay i understand now. Thanks everyone for all your help! (by mjpin1)
compiler error "left operand must be l-value"
 
I am having problems compiling this program. line 29 causes the error "left operand must be l-value". Please help me to fix this. 1 // chap5proj.cpp : D...
[2 replies] Last: thank you very much. Also, I apologize for the lack of whitespace (noo... (by mojorising484)
Program will not output correctly
 
My assignment was to write a program that will take in an ISBN number with dashes and check to see if it is a valid ISBN. The program is meant to stop when the ...
[no replies]
Need help on my program I can't get it to work properly.
 
I am having an issue getting my program to output correctly, and having the loop repeat. The program is supposed to have a user input a phone number with lette...
[6 replies] Last: Sorry for the late reply, but I ended up getting the program to functi... (by titan93)
Need a function to do an output
 
Want to do a function Linearsearch and need to know how to search on age and print it. // Bubblesort.cpp : Defines the entry point for the console appli...
[6 replies] Last: Yes, I got it to work. Thank you! /P (by patriic48)
Which option ?
 
Hello :) If I have a string like "ngc6910" and have converted the 6910 part to an int using the stoi function, and want now to modify the originally string, so...
[1 reply] : I would prefer std::to_string because it's less messy. (by Peter87)
Want to change a char in a vector of chars
 
I don´t know what I´m doing wrong in the code. Need some help. #include <iostream> #include <vector> #include <algorithm> #include <string> usin...
[6 replies] Last: @patriic48 - Your if statement inside your last for loop is wrong. Wh... (by art1986)
Passing values between 2 functions
 
When I try to compile my program, I get a build error that n1 and n2 aren't being initialized. I want to start my first function Input(), send the values to mai...
[3 replies] Last: n1 = from; n2 = to; that's exactly what's missing in your first post.... (by ne555)
PC too dumb to read
 
So i get almost all my declared variables undeclared... any suggestions? #include <iostream> #include <string> #include <iomanip> using namespace std...
[4 replies] Last: It could. But honestly, the standard library string is so widely used... (by Esslercuffi)
October 2014 Pages: 1... 1920212223... 70
  Archived months: [sep2014] [nov2014]

This is an archived page. To post a new message, go to the current page.