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

Creating a String Array that reads string from a file
 
Hello, I am fairly new to programming in C++ and I am having difficulties getting my code to work for my homework assignment. I code crashes whenever I attempt ...
[8 replies] Last: Thank You! That fixed the issue I was having. (by Wsaint1990)
by frek
C++ facilities
 
Hello all, What are most common C++ containers and std::algorithm facilities (functions, operations, etc) that a C++ programmer needs to be familiar with for...
[10 replies] Last: Thanks so much all guys. I got it. I appreciate your time and help. (by frek)
How do i add SFML to my path in atom text editor
 
I do not know how to connect SFML to my path for Atom Text Editor. If there is no way to add it to Atom can you tell me a different header to use for graphics o...
[1 reply] : Should probably ask this on a forum for Atom. (by zapshe)
Hailstone Numbers
 
Hi there, I recently got an assignment to create an algorithm for hailstone numbers. I've managed to complete most of it however I'm having an issue when it com...
[5 replies] Last: Thanks for that! I'll definitely make sure to not make a habit of it. ... (by rainyday)
how read the GIF and JPG image size? (1,2,3)
 
from the JPG format: typedef struct _JFIFHeader { BYTE SOI ; /* 00h Start of Image Marker */ BYTE APP0 ; /* 02h Application Use ...
[56 replies] Last: is windows and the readimagefile() reading the last icon instead the 1... (by Cambalinho)
by qawsed
count type of apparations in a csv file
 
Hi, I have to count the occurrences of each categories (Action, Adventure, Animation ...) in a csv file. The csv file is movies.csv and is here http://files.g...
[4 replies] Last: ghosts in the machine? if you are tasked to do this with threads, you... (by jonnin)
The Little Scrollbar That Could Not
 
The new Windows Terminal version has been recently released. Everything would be fine, but the performance of its scrollbar leaves a great deal to be desired. T...
[no replies]
Need some help with this math code.
 
Hey guys, alright I'll get right to it, I'm stumped here. Here's my code as it stands. #include <iostream> #include <vector> #include <string> #include <cmath...
[10 replies] Last: @DaisyDoyle is a stealth spammer. Just delete people like that. (Her o... (by dutch)
Help!Code not comparing text files
 
<nothing, OP gone>
[2 replies] Last: So what is and where is something named "readFileText1"? (by jlb)
Creating a text file in run time
 
I'm trying to copy the data in one text file to another 'new' text file. The first text file already exists in the directory of the .cpp file. The second text f...
[6 replies] Last: Thanks @ne555.It works now. (by Spacerun)
formatting for line with "Game Results: " backwards
 
#include <iostream> #include<ctime> //FOR RAND AND SRAND #include<cstdlib> //FOR TIME FUNCTION #include<iomanip> #include<cmath> using namespace std; const int...
[2 replies] Last: Since you're not using the return result of coinFlip, and that result ... (by salem c)
Custom allocator method is not called
 
I am trying to learn and write a self custom allocator - I was expecting that the cout statement in MyAllocator allocate method should be printed but it never d...
[1 reply] : I'm by no means an expert on writing allocators but implementing rebin... (by Peter87)
How can a mixin see the template class it is wrapping was instantiated on?
 
I use the mixin pattern a lot in my C++ programming. I love this pattern as it has many of the advantages of the pipeline pattern but higher performance (I hope...
[2 replies] Last: … a template class that inherits from one of its template arguments... (by Enoizat)
access a member data/function from a function of an object instantiated in target scope
 
How can C++ access all public member data/functions from within a function of an object instantiated in the same scope of that access target? illustrated such ...
[3 replies] Last: At first sight, it seems a classic circular dependency problem. Exampl... (by Enoizat)
Using Qt C++ codes in Android application
 
I have an Android application in Android Studio and I want to use Qt C++ codes in my app. I have used pure C++ codes in my android app using cmake and NDK recen...
[no replies]
Creating an invoice but I need help to correct the errors
 
#include <iostream> #include "string.h" using namespace std; //Declaration of the functions //int Job_Estimator(); int Help(); int Undercoat(int Total...
[no replies]
by kt992
how to calculate average of the price from files within the main function
 
hi can anyone help me with the code in how to find the average of the price from a txt file and display all the information of the book when the price is great...
[1 reply] : //compute the average sum := 0 n := 0 while read the file: separat... (by ne555)
by ravss2
Exception problem in C++
 
I am trying to understand exceptions in C++, below code i was expecting answer 42 32, but somehow it is giving error. is there any problem here, please help....
[2 replies] Last: As of C++11, it is an error to throw from a destructor without declari... (by Cubbi)
by ravss2
access members using object address
 
Hi, Below program prints 42 for arr ; and 33 for arr ,is that correct always or is it just a coincidence? Can we identify the internal object structure w...
[1 reply] : This is not safe. Its not a 'concidence' -- you found the offset of t... (by jonnin)
How concatenate string type with char array type
 
How concatenate string type with pointer to char (char array) type #include <iostream> using namespace std; //... string m, s = "foo"; const char *t = "bar"; ...
[4 replies] Last: // m = s + t ? // illustration only Why "illustration only"? This d... (by Repeater)
March 2020 Pages: 12345... 7
  Archived months: [feb2020] [apr2020]

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