Beginners - September 2016 (Page 7)

Vectors, objects and sorting
 
I'm trying to sort and populate a vector of objects with integers from a file. int fileSize reads the first line to determine how many numbers I should read aft...
[5 replies] Last: The code below fully sorts the vector by m_ip (and not frequency). I u... (by Arslan7041)
2D Array that places CH at each spot stepped to
 
Hello. I am new to C++ and I am having a hard time getting the correct output. My program takes a 2D array and places characters in it by stepping from spot to ...
[3 replies] Last: Hello binahearts, I think you may have misunderstood me the function ... (by Handy Andy)
Switch Madness!!
 
So...in my haste I started working on the wrong assignment and neglected the one due in <100 minutes. I am trying to write a program that allows a user to sel...
[3 replies] Last: I can help you with some compiler errors within if else if statement a... (by TheCowstah)
Calendar - display name of specific date
 
So basically I need to make the program display the 10 input dates then calculate the day of the week. The program runs and I believe the algorithm and most of ...
[1 reply] : On line 127 you create a nameDate object, but you never initialize i... (by Duthomhas)
Printing error with constant
 
Write your question here. I'm doing this assignment for my class. I have gotten the program to ork but I am having an issue. When the program prints it...
[1 reply] : In your code you're using MAX_STUDENTS as an argument for some functio... (by EricPlusPlus)
50 Zeroes Loop
 
So this is the assignment: This program asks the user to type in a number from 1 to 50. If the user does not type a valid number, it will continue asking the...
[1 reply] : Three loops, indeed. Do you know how to print out one 0? It takes a l... (by keskiverto)
recu123
 
deci -> bina int binario(int n){ if(n>1) binario(n/2); cout<<n%2; } invert void invertir(int nro){ cout<<nro%10; if (nro>10) inve...
[1 reply] : Por favor, haga la pregunta. Ayúdanos a ayudarte. Please ask a quest... (by kevinkjt2000)
How to run other functions in a function
 
I am trying to make a timer program, and have it all set out. Just one problem, i can't get the other functions to work. I am completely new to C++, just a coup...
[1 reply] : Try placing the runcode() function above main() rather than below it. ... (by EtDecius)
Doubles lose their decimal places!?
 
Hey can someone help me figure this problem out? The point of this program is to create 10 random ints and doubles, and chars. It then sorts sorts them from...
[2 replies] Last: So in the your output file, the doubles section had decimals? (by Drumples)
File not creating
 
So i've made a program that asks you for a filename and then creates a file with the name you've said, but it doesn't create nothing Code: #include <iostream...
[9 replies] Last: Well on mine, it's just creating a file like this : ".txt". I think i... (by cire)
Void function returning doubles w/ decimal
 
Hello, I have a structured a program that collects data from the user, then calls void function, this void function then calls 3 different value returning f...
[4 replies] Last: Thank you Chervil, I was finally able to fix my error. I had no idea y... (by dawnstar)
huffman decoder
 
updated: ---------- i came up with a code to create the binary tree for my key (huffman encoder). .h namespace file_info { class scanner { private: std::...
[5 replies] Last: Good luck. (by jlb)
Segmentation fault(core dumped)
 
Well... This is my code and I encounter Segmentation fault(core dumped)... I found where it is but I don't know why. How can add one to a integer cause a Segmen...
[1 reply] : My first suggestion is that you stop using VLAs and either make your a... (by jlb)
Project with a Class Date to input 1/1/00 as the date and also overload.
 
I need to input my textfile call date2test. I am not sure where to put them. Please help! //Letty Jolley #include<iostream> #include<fstream> #incl...
[3 replies] Last: Thank you for your help Andy. I really appreciate it! (by jolley1002)
Classes accessing each other
 
Hi everyone, So I heard that classes can friend each other, but the only problem is that when I try to do it the compiler won't let me because it says that t...
[6 replies] Last: Ok I see. Thanks. So globally it's much easier to simply have a class ... (by leoleoleo)
Weird... (1,2)
 
I felt like my c++ knowledge is leaving me... can you do something like this? if (something !== 5||2||6){ balah blah blah } i don't know if you can...
[22 replies] Last: if (something !== 5||2||6){ balah blah blah } There are three error... (by Chervil)
by Daias
Operator Overloading -
 
Hi guys, now I try to learn about operator overloading, I understand something but not it all. I want to decrease the salary by 100, I don't know if my function...
[4 replies] Last: Thank you so much, now I understand, . Thank you again. :D You explain... (by Daias)
Need help using strings in a switch
 
In the code below I'm trying to assign a different value (name of mineral) to the string in each case of the switch. However in it's current form the code just ...
[1 reply] : Well first of all you are trying to create and assign a string inside ... (by rabster)
Hint please!!
 
How should I write this program if I have to write it with "for loop" instead of "if"... #include <iostream> #include <ctime> using namespace std; void Ch...
[3 replies] Last: cin >> no_of_loops; for(int i = 0; i < no_of_loops; i++) { // gen... (by closed account 48T7M4Gy)
by roots
Constructor (1,2)
 
When I am debugging this, the initial values of pi is no 3.14159 but some huge negative number as is the radius. Not sure what i am doing wrong here. usin...
[22 replies] Last: #include <iostream> using namespace std; #ifndef CIRCLE_H #define CIR... (by closed account 48T7M4Gy)
September 2016 Pages: 1... 56789... 34
  Archived months: [aug2016] [oct2016]

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