General C++ Programming - March 2016 (Page 3)

Problems with functions for c++
 
We have a problem that asks us to write a void function that uses two nested for loops and the modulus operator to print out prime n integers. The function prot...
[2 replies] Last: You don't need to return the value. In this problem you are to just pr... (by Stalker)
Encrypting/Decrypting using transposition cipher
 
Hi. I am writing a program for my CS2400 class as homework where we are to either encrypt a message, decrypt a message, or let the user quit. I began by settin...
[2 replies] Last: Is there a specific place I should put these? (by baronrhys)
char card symbols problem
 
I'm trying to output the unicode characters for a card deck. I need help in implementing it. I didn't think it would be complicated. #include<iostream> int...
[8 replies] Last: What does this code give you: #include <iostream> #include <clocale>... (by Moschops)
by dn90
Double hashing issue.
 
FindPos function: static const int R_VALUE = 55603; template <typename HashedObj> int DoubleHashTable<HashedObj>::FindPos(const HashedObj & x) { unsigned in...
[1 reply] : Run it under a debugger. Look at the values of variables at the point ... (by Moschops)
by Hamfam
Bool is setting itself to false
 
Hey guys. I've got this bit of code that is beginning to frustrate me so much and I just can't figure out why it isn't working the way I want it to. I have a b...
[4 replies] Last: Also, your Location class probably shouldn't have booleans representi... (by keskiverto)
by Gyiove
calculating avarage without knowning the sum of numbers but there are clues and the pattern repeats.
 
Hello everyone! Lets imagine that we have a vector full of numbers: vector<double> nums nums.push_pack( 0.5 ); nums.push_pack( -0.3 ); nums.push_pack( 0.9 );...
[7 replies] Last: I insist, ¿what's your physic problem? I agree. You've posted a v... (by dhayden)
Need help for carry array Integer operator+ function
 
I have the code: LargeInt LargeInt:: operator+(LargeInt &other) { int carry = 0; int temp = 0; LargeInt ret; for (int i = 0;i <length;i++) { ...
[2 replies] Last: The if (carry > 0) ret.info[i++] = carry; within the loop makes no s... (by keskiverto)
by Banlom
Question to split by words
 
Hey, i have a problem to split a string with strtok. My String i have to split looks like this: "|0|H|h |h|r|0|H|h |h|r" The problem is, that this s...
[2 replies] Last: Yes, the numbers are always in the square brackets. What do you mean w... (by Banlom)
Problem with exchange sort int float pairs
 
File name:CSC2144N.txt Contents of .txt file -------------------- 10 7.35 -21 45.9 3 -4.56 85 34.1 -9 -32.7 -------------------- Hi this is my assignment for m...
[3 replies] Last: Yes, I'm looking through the rest of the code now. The thing to do is ... (by Chervil)
rot13
 
Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your main function should be...
[3 replies] Last: I added #include<string> and I think it's working (by stormy6161)
How to run C++ programs on Mac or Linux?
 
Hi. After creating a console program or a GUI C++ program how to run it on Linux and Mac? Does C++ is a cross-platform language like Java Java built programs...
[2 replies] Last: Thanks buddy (by omer123)
Map<vector<vector<int*>*>>
 
I am very curious why the following code compiles and yet does not produce a map of the expected values. I would expect the output to contain a vector of refere...
[3 replies] Last: Why on earth would a that loop return a local copy? If you don't spe... (by cire)
Getting Rid of Global Variables
 
I created this program that outputs a menu for a baseball game, allows the user to choose form the menu, calculates sub-total, tax, tip, and then asks for tende...
[1 reply] : //Function prototypes void showMenu(); void showBill(double, double, ... (by cire)
by jam47
expected constructor, destructor...
 
It's on line 43... and I don't know where to resolve the error. It says expected constructor, destructor, or type conversion before '(' token. #include <iost...
[2 replies] Last: Thanks ne555, I will study that. (by jam47)
Trees
 
I have to build a tree, not a binary tree or any special tree. The instructions say build the tree i was given on a handout, pre-order traverse it and then prin...
[1 reply] : class node{ container<node> children; }; class tree{ node root... (by ne555)
need help
 
Hey guys need some help, im a noob when it comes to c++ but im having an issue when it comes to 2 parameters in a function. Im trying to match my code with the ...
[2 replies] Last: thanks, i was looking into to but im still a little confused. once i d... (by undecked0)
How to sort alphabetically
 
This is what I'm supposed to do: Write a program that reads two input files whose lines are ordered by a key data field. Your program should merge these two fil...
[4 replies] Last: I don't understand how to alphabetically organize it? To determine i... (by dhayden)
Help with ambiguity
 
Can someone resolve this ambiguity for me? The function 'test' is supposed to determine how many arguments a given function needs (from a given tuple). #inc...
[2 replies] Last: Here's one way I've found: #include <iostream> #include <tuple> #inc... (by prestokeys)
socket programming issue
 
I have this Atmel code (see attached files) that I have modified for my needs. It connects to my wifi home router and sends out an SMTP email. I could not get ...
[1 reply] : anyone ? (by aliyesami)
by RianB
Vector2 Struct: Unresolved External Symbol
 
I keep getting Error LNK2019: unresolved external symbol. Could someone please look at my code, and tell me what I am doing wrong... Using VS 2013 File main.cp...
[1 reply] : Solved... I decided to make the Vector2.cpp file, inline... (by RianB)
March 2016 Pages: 12345... 23
  Archived months: [feb2016] [apr2016]

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