Beginners - May 2014 (Page 40)

Pointers used in arrays and incremented
 
I'm trying to write a lab for my c++ class and a can't seem to get my pointer "ptrarray" to increment by a number set by the user based on the initial number of...
[2 replies] Last: Yup that got it working the proper way. Thanks for the help! (by Hubbs66)
Taking input from the standard input
 
I'm currently writing a program that reads from a file, I have it decide what file to open and parse with this code: cout << "What file would you like to ...
[1 reply] : You probably don't have to do anything. .\program < myfile.txt will ... (by Peter87)
Calling functions of a templated class.
 
Hi, I'm working on a bit of code that performs stuff on matrices. I wanted the actual data to be flexible, so I made it a template. // In Matrix.h #in...
[2 replies] Last: Ah, that fixed it. Thanks, man! (by Gaminic)
Hash Tables
 
Assume that we have a hash table that uses separate chaining to resolve collisions. If the table is 256 long, what is the maximum number of entries that can be ...
[1 reply] : The format of the question implies that you are familiar with that "... (by keskiverto)
Help with this istringstream
 
I'm currently working through the C++ Primer book and I'm at istringstream section and there is an exercise as follows: "The program in this section defined ...
[4 replies] Last: Ahh yeah, so I suppose by creating a a new one every loop, it's in a g... (by Wallboy)
Basics of arrays
 
I wonder if i could shorten the following code #include <iostream> #include <cstdlib> using namespace std; int main(int argc, char** argv) { int Tabela...
[4 replies] Last: thanks for the answer (by Acookook)
Just started working with strings, what's wrong with this program?
 
When I try to enter input it won't let me enter anything for string m2 or string m3. What's weird is when I simply rearrange the code it works fine. What is wro...
[2 replies] Last: Thanks! So pressing Enter causes a newline character('\n') to be store... (by Indubitable)
nn
 
n j
[4 replies] Last: yes i did, can you just help with the code for offset ? please (by WALIA794)
Categorizing values into a bucket-please help
 
Okay so here is the assignment: The program does the following: 1. first prompt the user to find out how many bucket values are there. You may assume there is...
[1 reply] : #include <iostream> using namespace std; int getBucket(const double ... (by JLBorges)
hangman game
 
in visual studio, im trying to make a hangman game that selects a random word from a file. on compiling, it gives the error: "error C3867: 'std::basic_string<ch...
[2 replies] Last: oh my god thats so obvious. k thanks haha (by josepho16)
Getting zero return value from Binary to decimal function
 
Guys I'm getting a 0 every time I run this program. I'm not sure if only the base case is getting executed or if I am just missing something. Can anyone tell me...
[3 replies] Last: I can't believe I missed that thanks for pointing that out. should be ... (by JBIRD304)
One class using another class
 
okay so I have two classes and I want one class to use the other class but I dont want it to be a base and derived class situation. This is my code so far, Im n...
[4 replies] Last: Your welcome :) (by Codermik)
Error in pow function
 
Hey guys I know the pow function takes 2 doubles but I static casted it to an int and I still get the error more than one instance matches the arguement list. ...
[5 replies] Last: That fixed it but for some reason I keep getting zero as my output. (by JBIRD304)
by hwy63
Print all data members from n classes
 
Hello, So I am trying to create a program that simulates a bunch of Rovers driving around and hopefully not bumping into each other. I am sure I will have more...
[2 replies] Last: Thank you for being blunt. I did start over and now making some progre... (by hwy63)
by vRltwE
__attribute__((packed)) misuse?
 
I'm trying to limit the size of struct/enum by means of the __attribute__((packed)): enum LogIdentifier { LogIdentifierHouseKeeping = 0x01, Log...
[3 replies] Last: Peter87, I'm in a x64 win. Might that be the reason? AbstractionAnon,... (by vRltwE)
classes private data
 
ok so this program is supposed to end up calculating a final letter grade based on these 4 assessments. I have all the required functions but it isn't working o...
[5 replies] Last: your setScores should do what your getScores is doing. getScores shoul... (by pepstein)
class help!!!!!
 
I dont know why its not acknowledging the base class. Please help me understand what I am doing wrong. // main.cpp #include"Bird.h" #include"Mammal.h"...
[3 replies] Last: THANK YOU SOO MUCH! (by suhuhuhu)
by Kapi
Problem with my first program
 
Issue fixed. Thank you for all the help.
[6 replies] Last: Yea, I was actually curious to see the code, but it was gone :) (by TheConfused)
classes/structures
 
ok So this program takes a students four scores and reports back their grade but it is not working and reports the grade F every time. I tried cout<< q1 and it ...
[4 replies] Last: Oh ok I was unaware that you could do that for these functions thank y... (by ashald33)
inc and dec of array
 
hi guys, how do i go about testing if an array is increasing? i am entering weekly profits into a dynamic array and i need to then test weather weekly profit...
[1 reply] : What kind of dynamic array are you using? And do you want to test if t... (by fafner)
May 2014 Pages: 1... 3839404142... 55
  Archived months: [apr2014] [jun2014]

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