General C++ Programming - August 2018 (Page 2)

by lo2
Different values at same index double*
 
Hi, So I have a function that amongst other arguments takes in an argument double* X. The function behaves so that X is not mutated, its values are simply used...
[5 replies] Last: Do you have an explanation of what went wrong? If both r and x were ... (by tpb)
c++ operator[] operator,
 
I want to implement a matrix operator , like Python Matrix<4,4> m; m[0,0] = 0; m[0,1] = 0; How to implement?
[1 reply] : You can't - it's a language limitation. Use the parentheses instead (... (by mbozzi)
literal suffix for string not compiling
 
I have: #include <string> using namespace std; void f() { auto x = "hello"s; } and the compiler complains about the suffix s. it...
[2 replies] Last: Got it... Thanks... (by JUAN DENT)
about strings limitations
 
using 2 mark quotes, the ' " ' it's printed: """" prints: " so see these text: "var name as string = \"hello "" world\"\n" letter by letter how can i comp...
[3 replies] Last: thank you so much for the correction (by Cambalinho)
Division of matrix with complex numbers
 
I have Hermitian matrix which is generated from Z=HH' where its diagonal elements consist of real numbers. Then, from the diagonal elements, I would like to put...
[2 replies] Last: Thank you for your feedback lastchance...yes ..you are correct...z is ... (by nurulhudaismail)
Functions
 
#include<iostream> using namespace std; int abs(int); long abs(long int); double abs(double); int main() { int i=25,j; long l=-100000,m; double d=-12.3...
[9 replies] Last: Well now you have done it Ganado... If you need to include <cmath> ... (by Manga)
Configure Outlook Customer Service Phone Number 1-800-614-419|
 
Wrong section, wrong forum, wrong website. Get the F*** out of here.
[1 reply] : Don't reply to spam, just report it. (by helios)
Building Hieroglyph 3 engine
 
I am trying to build a Direct3D engine using VS17 but I get the a lot of errors related to DirectXTK, here is the engine link if you want to help me: https://ar...
[1 reply] : I assume you already installed the vs2012 for vs2017 dependency. And ... (by poteto)
help me to understand this code.
 
plz help me to understand this code. how can i solve this code? all details in main() function with commenting out. #include<iostream> #include<fstream> ...
[1 reply] : Please put your code in the source code tags so the indentations are... (by ElusiveTau)
Need Help in displaying the right output.
 
Hi, I need a little bit of guidance. I have to write a program and the sample runs is like this: > g++ -o star stars.cpp -std=c++17 > star Enter file name >> ...
[1 reply] : You don't need to say std:: in front of things if you've said "using n... (by tpb)
How to display output from the file and modify it
 
This is the content in the file: Acrux~Alpha 1 Crucis~HR 4730~HD 108248~320.00 Achird~Eta Cassiopeiae~HR 219~HD 4614~19.41 Ain Al Rami~Nu 1 Sagittarii~HR 7...
[8 replies] Last: I think you would be well advised to create a struct Star to hold all ... (by lastchance)
Machine code to Assembly Language
 
I'm trying to write a program to convert machine code from a text file to assembly language. I can read the file lines no problem as strings, but was given the ...
[2 replies] Last: Thanks. That's very helpful. I wasn't aware you could read in as hex. ... (by dgfrey102790)
Inheritance (Stack and Queue Inherit Array)
 
I am new to C++ programming. I have a task: Define an inheriting system that can inherit a class called “myArray”, this class will include virtual function...
[8 replies] Last: Here's an example that I came up with. If I'm reading the assignment r... (by dhayden)
Read & Write From File In C
 
Hello, To Improve my C skills, I've decided to create my mini programming language. It will read a string from a file and react as the context of the string. He...
[2 replies] Last: These should get you started. http://www.cplusplus.com/forum/general/1... (by kbw)
How to read up to special character from input file
 
Hi, I want to read and print out special character from a file. The input file looks likes this: Acrux~Alpha 1 Crucis~HR 4730~HD 108248~320.00 Achird~Eta Cassi...
[3 replies] Last: Use getline for the input from the user. https://en.cppreference.com/... (by Repeater)
How to access an element of variadic pack in enable_if_t
 
Suppose I have a function template like this (this is not valid C++ - just for transmitting the idea): template<class ...Ts> std::enable_if_t< std::is_sa...
[8 replies] Last: > Couldn't you strip off the first type in the usual way? One could. ... (by JLBorges)
Weird behavior on passing pointer by reference !!
 
Hello ppl :), I am not sure if this is some pitfall when passing pointer by reference. Kindly help me understand this behavior. The question is to print the v...
[2 replies] Last: Thanks alot tpb for explaining that post recusrion code was the actual... (by kapil2905)
How to get only a specific part of a Textfile
 
I need help only getting a specific part of one line on a text file The text file looks something like this: 1532544950: DP CompType: 72 1532544950: DP U...
[11 replies] Last: Find the line with UniqueID: and then use string.erase to delete the f... (by SamuelAdams)
Checkbox functionality
 
Hi, I am making a GUI system for my engine, and I have access to all the framework. The problem is that the select - unselect functionality does not work: The ...
[3 replies] Last: graphics run what, 60-80 hz? Its probably sufficient to check every 5... (by jonnin)
Random Coordinates
 
I want to generate 100 random coordinates in 3D space satisfying the following conditions: 1) the maximum value of any coordinate is less than 14 2) the dista...
[8 replies] Last: I'm finding it hard to read without the indentation. Please use the ... (by lastchance)
August 2018 Pages: 1234... 7
  Archived months: [jul2018] [sep2018]

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