Beginners - February 2017 (Page 26)

Hex to ASCII to Binary
 
I want to make two functions. The first function converts Hex to ASCII the second function converts ASCII to Binary I think I already got the first funct...
[9 replies] Last: Consider how to do this by hand first. Take the 1st 4 characters in yo... (by dhayden)
QT splitters
 
Why when I run this code, it runs correctly but the two push buttons don't have a splitter #include <QApplication> #include <QSplitter> #include <QPush...
[2 replies] Last: That actually worked thank you sir. (by Day Vide)
Function to determine if a string is made by all distinct characters
 
Hello all! Here is my idea: sort a string s, introduce an iterator goes through the whole string, and check if for any given character, the character is equal t...
[19 replies] Last: OK, testing for the worst case scenario (long strings with no duplicat... (by Peter87)
Counters mess each other up
 
Hi again, hope I posted this correctly. I wrote some code to simply count words, lines and characters in a text file. But when i run this entire code the output...
[4 replies] Last: I did peek the way above but still get one char less in my output, may... (by turtleman1)
by Scyl
Operation Overloading
 
How do I overload the function so that Correct appears? Student constructor is firstName and lastName. I've been looking up operator overloading and it'...
[1 reply] : Assuming firstName, lastName are type std::string, you need to overloa... (by gunnerfunner)
Random Number From Array
 
I want to pick a number for my array, and then add one to the corresponding variable. So, I think I'm doing it wrong because it outputs: You got 0 one's You...
[11 replies] Last: Oh I did not know rand() can be so bad. I will bear with this semester... (by Sanboro)
Variable array size in a class
 
Hi, I am wondering how to create a variable array called "ValueFilter", the variable size being defined using "LengthFilter". Thanks in advance class ...
[18 replies] Last: still could, just check its size if a vector and if too big, complain ... (by jonnin)
Class Contructor
 
I know that an object of another class can be initiated using the method below but this is a variable that was declared and not a function. I don't fully unders...
[3 replies] Last: or name(aName) (by closed account 48T7M4Gy)
Class: Instantiate array in constructor?
 
Hello, I'm sort of new to C++. I've written C++ in primitive codes before and then learnt Java because of course requirement. I need confirmation of am I hea...
[3 replies] Last: 1. In C++, this is a pointer, not a reference. Use the indirect me... (by mbozzi)
Trying to convert Psuedocode into C++
 
// START // Declarations // number id // string ownerName // string breed // number age // number weight...
[4 replies] Last: OP: you can all consider using a struct and it's ctor to instantiate D... (by gunnerfunner)
How to Create a Library of Functions in Visual Studio?
 
Hello! My teacher wants me to write a bunch of functions to save into a library that I can use in other programs. How do I create and save a library? I'm using ...
[3 replies] Last: I seriously doubt your instructor wants you to create a DLL file, espe... (by closed account E0p9LyTq)
by NateE
classes to inherit from the Shape base class
 
What I am attempting to do is have the classes to inherit from the Shape base class. I am receiving errors for the rectangle class. I missed something. Also the...
[3 replies] Last: Thank you so much.. I found a couple more mistakes and fixed those. It... (by NateE)
need help figuring out why program is crashing.
 
Hi, I am trying to dynamically allocate memory in my code. For some reason my program crashes when entering a quantity and says I have hit a break point and bri...
[7 replies] Last: pleaseINeedHelp, Here is an example of what you have (more or less) -... (by xismn)
Undefined reference to functions
 
Could someone explain why every time I call a function in main, it says it is a undefined reference to it? main.cpp // A Sophisticated Rectangle Class #...
[3 replies] Last: Thank you for all the suggestions. The main problem was that they were... (by Jack816)
User input to find prime number
 
I am having trouble with this code. It is supposed to read a number that is inputted by the user, then tell the user whether that one number is prime or not. ...
[1 reply] : Please use code tags. http://www.cplusplus.com/articles/jEywvCM9/ ... (by integralfx)
by lajm
File I/O - File Output Problems (getting 0.00 as output; variables not initialized)
 
Hello, I have written a program to input ten floating-point numbers from an input file, read them, and then sum the numbers and calculate the average. The prog...
[2 replies] Last: Thank you so much! As you suggested, I needed to read in the values be... (by lajm)
Implementation file problem.
 
Could someone explain why my class 'Rectangle' isn't recognized in my implementation file? Rectangle.hpp #ifndef RECTANGLE_HPP_INCLUDED #define RECTANGL...
[6 replies] Last: I took out the #include "Rectangle.cpp" and that solved my problem. Th... (by Jack816)
Vector and command
 
Write a program that creates a vector of strings called V. Vector V grows and shrinks as the user processes the transactions from a data file called “data.txt...
[6 replies] Last: Thanks guys ! This is what worked. I don't think Insert is quite r... (by cire)
String subscript out of range error
 
I'm trying to create a program that takes in a number such as "12345678" or "12345678910" and formats them into "1-234-5678" or "1-(234)-567-8910" respectively....
[4 replies] Last: formatNumber is fed an empty string and you assume it was not. Not ... (by cire)
1 Dimensional hollow grid array?
 
Hi there. I've been tasked with creating a simple console game with some tasks included on how to complete it. My first task is to " 1. Write code which asks...
[11 replies] Last: Anytime. I am about to go offline... if you have any trouble, let me ... (by jonnin)
February 2017 Pages: 1... 2425262728... 37
  Archived months: [jan2017] [mar2017]

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