General C++ Programming - April 2015 (Page 2)

code for Mph to Kph. URGENT HELP!
I have to write a code to convert Mph to Kph. I'm lost on how I can fix the code. #include <iostream> #include <cstdlib> using namespace std; do...
Apr 30, 2015 at 12:40am
[3 replies] Last: dude, you only need one post per topic (by jasonwynn10)
by Debn
I need help for my hangman game
Can you help me? I'm making a hangman game but it's not working as expected. It's not filling the letters correctly. Here is the code: #include <iostream>...
Apr 30, 2015 at 12:32am
[3 replies] Last: This code should work for you: #include <iostream> #include <windows.... (by jasonwynn10)
Multiplying Random Matrices
i have this program here that multiplies two matrices together. you enter in the dimensions of the matrices and then the elements of the matrices. but instead ...
Apr 29, 2015 at 10:40pm
[1 reply] : http://www.cplusplus.com/reference/random/uniform_int_distribution/ ... (by keskiverto)
Do-While loop LOOPS forever
I have a text file (schedule.txt) that has data that looks like this: Monday, Physics 101, Calc 27, Chem 130 Tuesday, English 100, CompSci 87, Arts 147 Wednesd...
Apr 29, 2015 at 8:26pm
[3 replies] Last: @ Gamer2015 Thanks for the hint! It works !!! (by newbiee999)
help flipping stars around on this program
#include<iostream> #include<iomanip> #include<fstream> #include<cstdlib> #include<string> using namespace std; const int a = 8; int i, j, ary , n, s1...
Apr 29, 2015 at 7:20pm
[no replies]
segementation fault in main() believe its in the switch cases. HELP Please I'm lost
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> using namespace std; class TreeNode { public: char data; TreeNode *l...
Apr 29, 2015 at 5:24pm
[no replies]
Making "new" out of "malloc"
Yeah, that's not a particularly fantastic title, but it's the best I could come up with. // Construction Class* x = (Class*)malloc(sizeof(Class) * 3); for (uin...
Apr 29, 2015 at 4:21pm
[13 replies] Last: All right, I think I understand it now. Thank you. (by Schulter)
Parsing an input file to create a directed graph
So I'm starting a project on directed graphs and topological sorting. I'm looking for the most efficient way to parse an input file of courses in the form: C...
Apr 29, 2015 at 4:15pm
[no replies]
Get the last position of a string
In my isPalindrome function, I keep getting an error when I try a get the last position to find if a string is a palindrome or not. #include <iostream> #...
Apr 29, 2015 at 2:20pm
[1 reply] : figured it out. Forgot to #include <cstring> -_- (by thecohshow)
Linked List search Operations
So here I've got a linked list that reads in person data from a file(ss_number, dob, fname, lname, state of residence), then creates a linked list of states and...
Apr 29, 2015 at 2:12pm
[no replies]
Binary Tree Database Help
Here I've got a binary tree database. I have a insert method that should work but my read in file is completely screwed up because our teacher never showed us h...
Apr 29, 2015 at 1:56pm
[no replies]
Expected initializer before 'Iterator'
The code is like this: in .impl file, function definition template<class ElemType> typename DoublyLinkedList<ElemType>::Iterator Iterator Iterator DoublyLink...
Apr 29, 2015 at 10:05am
[2 replies] Last: Why do you make typename DoubleLinkedList<ElemType>::Iterator Iterato... (by Gamer2015)
Converting string to a char array?
How do I convert a string of unknown length to a char array? I am reading strings from a file and checking if the string is a Palindrome or not. I think my pali...
Apr 29, 2015 at 9:51am
[1 reply] : You can use std::string::c_str(): http://www.cplusplus.com/reference/... (by BasV)
C++ Command Line Timer.
Hey All, I am having a hard time creating a working C++ timer. I am just doing this for fun to see if I can. What it shouulld do is ask for an amount of minute...
Apr 29, 2015 at 7:58am
[1 reply] : Check this out: http://www.cplusplus.com/reference/thread/this_thread... (by coder777)
Confusion regarding rvalue references (1,2)
So, I've just recently discovered rvalue references in C++11, and I don't think I quite get it. Let's say I was making a wrapper class around std::string with...
Apr 29, 2015 at 7:29am
[24 replies] Last: That's... quite the explanation! Thank you, I think I understand now. (by Schulter)
Stable Sort
I have a program where I am given a large file of UC students that already sorted by ID. I need to sort it by the school they are attending and students attend...
Apr 29, 2015 at 6:20am
[7 replies] Last: and use the sort function sort(students,students+ len, compareBySchoo... (by Peter87)
Need some help this array code.
i can't seem to output the array i filled with random numbers into a file like notepad or mircosoft word. idk if what I'm doing is even correct.. pls help ;/ ...
Apr 29, 2015 at 6:12am
[1 reply] : You never call PrintArray anywhere. (by Peter87)
string matrix to 2D array
I am a very beginner and i need a function the would convert a string that the used enters in the form [2 -3;5 6.11;7 8] for example into a matrix , can anyon...
Apr 29, 2015 at 2:56am
[no replies]
by yj1214
Pointer members in the class
This one has lots of errors but i'm pretty sure it's just some stupid mistakes... #include <iostream> using namespace std; struct Hello{ Hello(i...
Apr 29, 2015 at 1:02am
[3 replies] Last: General rule of thumb: If you have to manually delete, you are doing ... (by Disch)
Vowel counting
I have to write a program that prompts the user to input a sequence of characters and outputs the number of vowels. The previous problem had me return true or f...
Apr 29, 2015 at 12:18am
[2 replies] Last: Thank you so much for the response. This works! I haven't come across ... (by Mohawkuu)
April 2015 Pages: 1234... 28
  Archived months: [mar2015] [may2015]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.