General C++ Programming - October 2021

Compiled files
 
There is a code that I can easily run through the terminal: g++ encode.cpp huffman.cpp -o main ./main inputFile.txt compressedFile.huf But how can I compil...
[3 replies] Last: Thanks everyone! (by prog2222)
by Paul5
Reading from text file and storing data into 2D array
 
I want to create a program to load all unique words of a specific file in an array and display them and also a program to load and display all words of a spe...
[15 replies] Last: Paul5, PLEASE learn to use code tags, they make reading and commenti... (by George P)
Some problem with results
 
Does someone khow why I have the same result of compression ratio with the using Shannon-Fano, Huffman or Arithmetic compression(coding). I have 52% ratio for ...
[1 reply] : you asked: Chef has some beans and some jars. How many beans should f... (by jonnin)
Read Files
 
Looking for help on this assignment cause i'm new to c++. Can anyone help me out with figuring this out? how to read multiples files with void prodecure? i'm ge...
[1 reply] : Three times https://www.cplusplus.com/forum/beginner/280676/ (by salem c)
Read Files
 
Looking for help on this assignment cause i'm new to c++. Can anyone help me out with figuring this out? how to read multiples files with void prodecure? i'm ge...
[1 reply] : https://www.cplusplus.com/forum/beginner/280676/ (by salem c)
Eclipse thinks __cplusplus is defined for a .c file!!
 
Hello, I'm utilizing Eclipse Juno with thew ADT for an Android NDK based task and I have tracked down that the Eclipse indexer thinks __cplusplus is characteri...
[1 reply] : Was your use of ".C" deliberate or finger trouble? Because .C (ie, ca... (by salem c)
by JRManx
C++ word library? (1,2,3)
 
Is there a good C++ (or C) word library? I just had an idea to make some kind of a Boggle cheating program and I realized I need a list of words. If there i...
[42 replies] Last: [quote=jonnin]the word [mainframe computer] triggers people like punch... (by JRManx)
Need Help Coding This In C++
 
Given This, code, for the stack header and implementation, have to create this program. For a given integer n (n>1), the smallest integer d (d>1) that divides ...
[9 replies] Last: First, posting with code tags and indentation makes code easier to rea... (by keskiverto)
Grade System using arrays
 
I've been trying to create a grading system using arrays but i've been having issues when it outputs. it doesn't output all of the courses i entered and the cor...
[2 replies] Last: There seems to be an issue re storing multiple grades for the differen... (by seeplus)
SORTS
 
Can someone help me with the last part of my code? I need help with sorts. There must be 3 total but 1 has to be a working sort algorithm (selection sort) and ...
[3 replies] Last: > Can someone help me with the last part of my code? ¿what's the last... (by ne555)
by Setat
Search a string.
 
Hi, I need to find a string which is started from the first of the line and replace it with another string, s1 = xxyyzz xxyyzz = ... s2 = ABCxxyyzzDEF A...
[1 reply] : string has .find() and .replace() ... just call them? if you need to ... (by jonnin)
Sample Questions
 
Hello.... can I ask a few questions for you guys? I just need a study guide in order to understand more in condition control structures. I'm just learning how t...
[4 replies] Last: oh-there it is. thanks bro (by Burkyburk)
by Wali23
Big number subtraction
 
Bigint operator-(const Bigint &n1, const Bigint &n2) { Bigint result; int carry = 0; for (int i = 255; i >= 0; i--) { if (n1.arr - n2...
[1 reply] : did you mean result = (n1 - n2 -carry) % 10 + 10; this is still no... (by jonnin)
a
 
One way is like this: void findMin(double& lowest, double n1, double n2, double n3, double n4, double n5) { lowest = n1; if (lowest > n2) lowest = n2; i...
[4 replies] Last: I don't think the OP removed their posts. More likely that they got re... (by The Grey Wolf)
Out of Memory/Crash issue
 
Which of below code , assuming there is no out of memory can happen, say if it is correct, if it will crash or performs more than one memory allocation? ...
[16 replies] Last: Thanks everyone for your suggestions. I will close this thread as solv... (by denver2020)
file input and output for a menu
 
Hello all, I've run into another issue with my classwork and this one has thrown me through a loop. The objective is to have a menu that displays 10 different t...
[3 replies] Last: [quote=dorito200] Hello all, I've run into another issue with my class... (by MikeyBoy)
Array Performance issue
 
Below code runs at different speed, when array is of huge size. Which one of these is faster? struct B { int i ; }; int Sample1(B* array, int ...
[5 replies] Last: you can probably unroll it to a single loop instead of a nested one an... (by jonnin)
Using Conditional State create a division program
 
Using Conditional Statement create a program to find if the number is divisible by 2 (also 2 is multiplied by the divisor) and if the n is not divisible by 2 an...
[4 replies] Last: Using Conditional Statement create a program to find if the number i... (by jonnin)
Code Crash Issue
 
My below code crashes at the below highlighted line. How can I fix it? class Animal { int age; float height; public: virtual float Eating(); vi...
[3 replies] Last: Post real code showing the problem. Not random snippets taken out of ... (by salem c)
Array in class and File operation
 
... the code goes here #define SIZE 25 #include <iostream> #include <fstream> using namespace std; class Student { private: string studentName...
[4 replies] Last: and the console is blank, Please help me to find my mistakes, Thi... (by seeplus)
October 2021 Pages: 123... 5
  Archived months: [sep2021] [nov2021]

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