Beginners - November 2014 (Page 14)

using substring inc++
 
I have a function(double divide)that returns double (a/b) e.g 12/23 =0,52173913 I want to use the result after the decimal(52173913) as string. From this I wan...
[no replies]
reading data in columns from a file
 
hello I am stuck on one of my homework problems. im trying to make the program read a file from my computer then make the file into an array. the code that I ha...
[1 reply] : while (InputFile >> hours >> payrate) { // other code here } ... (by closed account EwCjE3v7)
member functions of vector?
 
Why can't member function of vector be used, when i am using them on vector a class.. for instance I have this class. Class Test { public: vect...
[10 replies] Last: > but the iterator itself isn't it an integer? no. Iterators are used ... (by ne555)
Need help identifying errors please
 
I am having some trouble on this, can you you help please? Identify 5 errors, syntax or logic, and give reasons why they are errors in the following progra...
[2 replies] Last: Number 7 array can only have 3 characters not 5. 8 because array was n... (by closed account EwCjE3v7)
Simple Calculator Not Working
 
I'm new to c++ and I don't know very much. I was trying to make a simple calculator but the if statements don't seem to work. It will run both of them no matter...
[4 replies] Last: Just a thought, I don't know if the assignment requires they type in ... (by wildblue)
by leo255
Need some help with basic dynamic mem. allocation
 
Hi all, Can't get more basic than this. I'm getting an out of scope error in my copy function, when I try to copy the contents of the first array into the DM...
[1 reply] : Edit: found the answer. Shouldn't have declared int * newArr inside of... (by leo255)
Structures and dynamic allocation
 
I'm currently stuck on a homework problem. The questions asks "Assuming you have created the Speaker struct described in the accompanying question, write a getS...
[9 replies] Last: Ok i have figured it out. Thanks for helping. (by skimmer001)
Reading Data from a File
 
Hi all! I'm kind of stuck here. I'm creating a program that accepts a name or number as input from the user and is supposed to search and find that name or numb...
[8 replies] Last: Of course you can ignore the operator overloading, but you will have t... (by megatron 0)
2D array with linked lists.
 
I need to create a 2d array with linked lists. I need to use the command line input to do the following. Commandline> Final.exe 3 4 and then it would pro...
[no replies]
Random Number guessing program
 
Can someone check this program for me? It's supposed to create a random number with a max given by the user. Then the user has to guess. The computer tells if ...
[12 replies] Last: Okay, I think I got. Can someone check for me? #include <iostream> #... (by and kand 97)
by Horry
Logical gates calculator
 
Hello guys, This is my first post so sorry if I misspell anything. I need to make a program which will calculate a logical gates equation like A.(B^C) ...
[no replies]
Valgrind is complaing about freed memory
 
hello, I got a clean bill of health from valgrind before I added the check function. Now valgrind is complaining about a pointer that was freed in unload and wa...
[no replies]
Dynamic 2D Array
 
Hello, I have a dynamic 2D array that I'm decreasing size by one by a function. It may not always be the last row/column being deleted. It could be one in the ...
[2 replies] Last: And for the rows I could just switch around the variable in the array,... (by danghotties)
Pass the calculator!
 
I have to do a game using a calculator and the first step is to choose who starts, the player or the computer, it has to be random and I don't know how to do it...
[1 reply] : Before worrying about what to do at line 35, you need to get rid of yo... (by AbstractionAnon)
Finding the lead horse.
 
When I the code comes up to decide if the current horse is in the lead, it will choose that horse regardless of whether its distance > lead. Any tips would be g...
[1 reply] : Line 203: You've determined the winner and turned the racing flag off... (by AbstractionAnon)
to lower case
 
Having trouble with this dictionary spellchecker. I am able to hash the dictionary, and search the input for properly spelled words. I am having trouble with...
[16 replies] Last: The thing is, you output everything before line 236. Try outputting ag... (by giblit)
Time complexity (O notation)
 
If I have 3 parts of the code each part takes 1) O(n) 2) O(m) 3) O(k) n, m, k can be the same length at some point but most of the time they are differe...
[2 replies] Last: It depends on how those 3 parts relate to each other. If they execute ... (by Smac89)
by Scizor
Binary Search for Char Array?
 
Hello, I definitely know how to implement binary search when it comes to integers but I need to do it with a char array for a class project. I'm not good with u...
[3 replies] Last: Don't know what you had, so can't tell you why you got an error. Th... (by AbstractionAnon)
struct pointers to functions
 
I'm currently stuck on a homework problem. The question asks "Create your own Date struct that contains month, date, and year information. Create a compareDa...
[5 replies] Last: Lines 40-42: you're outputting a number. Not the most user friendly, ... (by AbstractionAnon)
Appending objects
 
I have a class which consist of an vector.. I want to create a merge function which appends a object to another object, the idea is that the vector which on...
[7 replies] Last: Good to know. (by shadowCODE)
November 2014 Pages: 1... 1213141516... 65
  Archived months: [oct2014] [dec2014]

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