General C++ Programming - February 2016 (Page 15)

by Sam786
Need help with C++
 
I need to do a program similar to this in C++,this is currently in java. Any idea on how to do it? Put the code you need help with here. [public static vo...
[3 replies] Last: Also, article on how to generate random number: http://www.cplusplus.c... (by naaissus)
selection sort issue
 
my second function Sort_arrays is copying my array1 into arrayPtr. i have determined its somewhere in the selection sort but i can not figure it out. the outp...
[1 reply] : Line 61: overwrites the new array with the old one. The new one is lo... (by kbw)
Finding Average. Trying to find the average of the numbers in string below. This is what I have so far
 
# include<iostream> # include<fstream> # include<string> # include<iomanip> using namespace std; using std::cin; using std::cout; using std::endl...
[3 replies] Last: http://www.cplusplus.com/articles/z13hAqkS/ It doesn't look like it c... (by Zhuge)
Reverse String
 
I initially posted this in the beginners forum, maybe too much to ask there, I have the string to change toupper and tolower but I cannot get the original strin...
[7 replies] Last: Needs context. It's not possible to say why the result is not as requi... (by Chervil)
ASCII TO STRING Conversion
 
Hi, I have been searching a while for a way to convert acsii code to and from a string, any help is appreciated.
[5 replies] Last: What if its a very long string, like for example 49 20 4c 49 4b 45 20 ... (by BobTheBuildingBuilder)
C++ operator ==, is it important to check self equality?
 
Given the the following code bool Foo::operator==(const Foo& other) { if (this == &other) { return true; } return name == other.name && size == other.size; ...
[4 replies] Last: > for operator= (assignment) it's usually critical. In modern C++, it... (by JLBorges)
Numerical or Decimal types in C++?
 
Hi, I was wondering if C++ has types to handle REALLY big numbers (let's say currency amounts with REALLY large sums) and whether these are not floating poin...
[4 replies] Last: You could use a 64 bit integer to represent the number of cents. (by dhayden)
Passing more than one argument to argv in VS
 
I need to know how to pass more than one argument to argv in Visual Studio Community 2015. I have this code for printing the number arguments passed in, but it...
[7 replies] Last: Guys, I already did ALL of that stuff. The code itself compiles in VS... (by DragonOsman)
String Find issue.
 
Hi Everyone! I'm having a little problem with the std::string find function. It's not working in the applied section, so I made a little test run and it's stil...
[9 replies] Last: Ah, it's alright. I'm sorry too! (by Hibblejaybob)
(Insertion Sort) How do I count the number of swaps comparisons and passes?
 
If I wanted to print out the total number of passes, swaps, and comparisons, where exactly would I place the counters in the insertionSort function? Thanks in a...
[1 reply] : Can you define what you mean by "passes", "swaps", and "comparisons"? ... (by Zhuge)
Decrypting with arrays?
 
Hey guys, i'm having trouble with one of my c++ assignments. It's about decrypting a string of letters. Here is a picture my teacher sketched up: https:...
[2 replies] Last: You're going to need to explain the algorithm. The screenshot of the w... (by Zhuge)
Feedback on Text Processing
 
Hey there, I'm new to the site. I'd like to put up a piece of code I've been working on and get some feed back on what I could do differently, or what I could ...
[8 replies] Last: > how clean your version looks The code looks cleaner because it uses... (by JLBorges)
store just one Row of a vector at a time
 
My vector finalNumbers could have 1-9 columns...could use some help in the right direction I want to pass in each row of the vector into a function; Thanks fo...
[no replies]
split line and store
 
Hi everybody :) I have a txt file with some columns, and I woul like take, for each line only the 7th and 8th values. This values I would like store in a vecto...
[4 replies] Last: Thanks for the file data example. Here's an outline of reading from t... (by Chervil)
by calgai
Question about const string array size
 
Hello, I got an interesting result in counting the size of const string array. Looks the sizeof returns different value in main and sub-function. Could somebody...
[2 replies] Last: Here array is pointer! Not array of strings. So size of pointer it is ... (by kulkarnisr)
by homing
assembly crash course for C++ Developer
 
Hey, Do you guys know any book or link where learn the most important things about assembly? I really would like to understand some assembly code for my C...
[3 replies] Last: Do a search on "intel assembly language tutorial" That seemed to hit ... (by kbw)
incomplete type
 
Keep getting the following compile errors. ..\src\main.cpp:36:13: error: field 'card_rank' has incomplete type 'Card_Deck' Card_Deck card_rank; ...
[3 replies] Last: int and Card_Rank are two different types. Simply assigning an in... (by Peter87)
by Zyion
How do I count the lines for the method and object. I can't figure it out. (1,2)
 
#include <iostream> #include <string> #include <fstream> #include <stdio.h> using namespace std; class LOC{ public: // constructor LOC (string fname); v...
[26 replies] Last: I got it to work kinda... thanks pnoid! it outputs the number of lines... (by Zyion)
std::string& input function throws bad memory allocation exception
 
I have to write a program for LearnCPP that uses a for-each loop to search through a fixed-size array for the name input by the user. I'm having to take input ...
[16 replies] Last: FWIW, I think it's a bad practice in C#, as well. It's just harder to ... (by helios)
Huffman compression
 
Create a simple class named Tally. Data members should include an array of 256 integer counters, for tallying occurrences of the 256 possible ASCII characters, ...
[2 replies] Last: Okay. I did it. Now what? (by Disch)
February 2016 Pages: 1... 1314151617... 21
  Archived months: [jan2016] [mar2016]

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