Beginners - March 2018 (Page 8)

by clbj
calculate molecular weight
 
i cant figure out why that my program is not correctly calculating the molecular weight of atoms. it may be in line 89 where it just gives me what is in there f...
[11 replies] Last: #include <iostream> #include <fstream> #include <iomanip> #include <c... (by lastchance)
by dean
[Macro] Token concatenation operator ##
 
Hi there, I'm still not able to understand how to use the token merging operator ## in C/C++ macros. Here I'd like to concatenate the actual term `profiler.' w...
[2 replies] Last: ok, so the ## is not required in this case, i.e. : #define PROFILER(... (by dean)
Trouble with Arrays
 
So I am trying to write a code that can take the names and scores of a certain number of people that is decided upon by the user. I then have to put it in order...
[5 replies] Last: You are working with two different data types for each student record,... (by closed account E0p9LyTq)
by zapshe
Using string with advantages of regular cin?
 
Hi - I've coded this calculator. In int main() I'm using "e" as a char so I can use cin.putback(e) - which is very crucial to this code! So is there a way to be...
[10 replies] Last: This calculator was just something I made so that every time I learned... (by zapshe)
Concatenate Multiple "char*"s
 
I'm having trouble with some code I'm writing that takes user input from a the console and concatenates it with arguments for a java application. using ...
[6 replies] Last: I example I quoted above, where a container has a number of homogeneo... (by TheIdeasMan)
"error: no matching function for call to 'Dog::Dog(const char [4], const char [5])"
 
I can't figure out what the issue is here. It occurs on line 60(and 61). #include <iostream> #include <string> using namespace std; #include <str...
[2 replies] Last: Line60: The class Dog does not have an appropriate constructor. You... (by coder777)
by zapshe
std::string::npos ??
 
Just overcame a huge obstacle in my code - took a while so I'm worn out. Anyway, in solving this mystery obstacle I used the code below. What it does is will ch...
[2 replies] Last: Ah! i see now, that makes perfect sense. The value of npos IS the high... (by zapshe)
iterate through a vector of strings
 
I'm trying to create a vector by a user entering words, storing these words into a vector, and then outputting them. What is the simplest way to do this at a be...
[1 reply] : Hi, A few things: The for loop needs to be outside the loop that col... (by TheIdeasMan)
Help with OOP
 
Hello. I am 14 and I have been learning c++ for about 2 months, and I have now gotten to the object oriented programming part of c++. I use Codeblocks and a boo...
[3 replies] Last: No worries, pleased to help :+) There are quite a few very experienc... (by TheIdeasMan)
by milesr
trouble with my char values
 
Hi all. I am taking my very first programming course this semester, so I am very new to all of this. I apologize if this is a simple fix. The purpose of this ...
[3 replies] Last: Hi trying changing this: if (gender != toupper(m) && gender != tou... (by TheIdeasMan)
Loop, and display of table for degrees
 
(The formula for converting a temperature from Fahrenheit to Celsius is C=5/9(F-32) Where F is the Fahrenheit temperature and C is the Celsius temperature. Wr...
[3 replies] Last: No need to have a temp variable in your function, you can simply retur... (by closed account E0p9LyTq)
Multiple Inputs
 
For my intro class I have to write a code that allows the user to input multiple integers. For example, I ask how many items that person has eaten that day (in ...
[3 replies] Last: Let me know what you think of the program that I made for you. In reg... (by ratfus)
Program doesn't work correctly.
 
I cannot find a problem within the code. My highest, average, and total come out to be the correct number. My lowest number comes out to be around negative two ...
[3 replies] Last: Alright I got it working. Thank you. It's my first time using this sit... (by noshkren)
by ratfus
Pointer program keeps crashing
 
Why does my pointer to pointer program keep crashing? Shouldn't I be able to point to another pointer? This pointer stuff is so damn confusing, despite the fa...
[6 replies] Last: PLEASE, learn to use code tags, it makes reading your source MUCH easi... (by closed account E0p9LyTq)
Vectors problem
 
I'm trying to make a program that displays the contents of various vectors, and for the last vector I need to make it display 5, 10, 15, 20, 25, and 30 using a ...
[2 replies] Last: Thanks, this works just how I wanted it to. (by Databend)
binary search comparison
 
Could someone help me figure out how I can get the comparisons of attempts in a binary search. The linear search gives me what place it is in but when I sort th...
[5 replies] Last: Have you run the program with your debugger? Set a breakpoint before t... (by jlb)
Overloaded operators and Copy constructor
 
so I have some trouble with my code, not sure if its something wrong with the copy constructor or the overloaded insertion this is the DoublyList.h #ifnd...
[1 reply] : This is the Main.cpp (These are just testing cases.I am not allowed t... (by kikiyox77)
Array Loop Question
 
Here is the summary of what I am trying to do. I am building a calculator using functions. I am having trouble getting the array to be evaluated for a received ...
[2 replies] Last: Those make sense. I will try revising my code with these to see if it ... (by Cryptic HyRulian)
Pass a .txt File Into a Vector
 
For my class, we need to read in values from a .txt file and input them into vectors to solve for a value. In my case, I read in values for grams, molecular wei...
[4 replies] Last: I'm glad it works OK. Now I look at it more carefully, you do need t... (by lastchance)
For Loop Initiation
 
I need help with DO_2. How do you initialize 2 variables in a for loop? I thought you could only do 1 variable? Thanks for helping out! #include <iostream> ...
[2 replies] Last: Hello piotrowskid, Initializing 2 variables in a loop is explained the... (by mycuser)
March 2018 Pages: 1... 678910... 29
  Archived months: [feb2018] [apr2018]

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