General C++ Programming - April 2020 (Page 6)

by Nana12
how to generate Random matrix needed
 
#include <stdio.h> #include <stdlib.h> #include <omp.h> #include <time.h> double mul_vector_transpose_vector(double* v1, double* v2, int n) { int i; ...
[12 replies] Last: dutch and Ganado,thank you so much for the help,I really appreciate,an... (by Nana12)
Make a online BlockOut2 with online score database
 
Hi. I have uploaded the source code of a game from 1989 called BlockOut , that is a 3D Tetris game to a online code editor. https://repl.it/@jlivingstonsg/BL...
[3 replies] Last: Here is the source code. https://sourceforge.net/projects/blockout/ I... (by jlivingstonsg)
by bibo
Errors on operations of datatype map of sets of classes
 
``` #include <bits/stdc++.h> using namespace std; class State; typedef map<char, set<State>> symbol2States; vector<string> split_string(string); char Eps...
[2 replies] Last: The map.find return a std::pair<char, set<State>> but getTransitionToS... (by thmm)
need help about math c++
 
hello, i am currently new in programming. So I made a program to basically calculate 2^n (n user input) #include <iostream> #include <math.h> using namespa...
[1 reply] : Maybe sum += pow(2,i); (by salem c)
Kruskals Algorithm. NEED HELP URGENT.
 
Minimum Cost To Connect Cities(Kruskals) You are to write a function that will calculate the minimum to cost to connect a group of cities. The cities will be...
[2 replies] Last: http://www.catb.org/esr/faqs/smart-questions.html#homework and http://... (by salem c)
by Uzi
PIR Motion Sensor with Piezo Buzzer and LEDs
 
I am trying to program a PIR motion sensor that will sense motion and turn on a piezo buzzer and LED light that are all connected on a Parallax Propeller. The c...
[1 reply] : Please edit your post for readability https://www.cplusplus.com/articl... (by salem c)
by bsmith
Recursion example
 
I am new to the idea of recursion in functions. For example, I'm building a program, but I want to try changing one of the functions to use recursion (so I can ...
[2 replies] Last: That function is not a good candidate for recursion. You could write a... (by dutch)
Need some help with Runge Kutta in c++
 
Please: - put your code sample within code tags, so that we can see the structure more easily. - tell us what the input should be; - tell us why you think the o...
[2 replies] Last: Whoever did that is a POS, there was nothing wrong with the OP other t... (by Ganado)
Understanding arrays as pointers
 
Hey, so in class, we learned about understanding arrays as pointers and we used it to print out a chessboard and now I'm trying to do the same on my own and I'm...
[6 replies] Last: You're right. Thank you, my good sire, (by john Alvarez)
I got this problem in the line "my_tree = insert(my_tree, 50)". How can I fix it?
 
#include <iostream> using namespace std; template <typename T> struct tree_node { T key; tree_node* left = nullptr, *right = nullptr; tree_node(T key) ...
[5 replies] Last: Good day. A lot of people face this problem. In the article: https://l... (by Merch)
New assignment
 
Hello everyone, I have another assignment and I was wondering if there is a way to have someone help explain what I need to do with this assignment. I had a...
[2 replies] Last: Sure, if you show us the assignment someone might be able to help. (by thmm)
extern "C"?
 
I know of an extern "C" keyword that prevents C++ from name-mangling to ease the interface of C++ code to other languages. However, what I don't unde...
[14 replies] Last: Heh, shows my age. Remember, I was programming Windows back when it wa... (by Duthomhas)
Help using fstream- kinda lost (1,2)
 
Hello all, i'm trying to create a program using fstream that calculates the sum, and average in the file. I'm kinda lost and can't really ask questions since ...
[24 replies] Last: [quote=ChrisValvo]"volume serial number is 184b-6cd1. Directory of c:\... (by lastchance)
by ammds
knight's tour question
 
Hello! I have some C++ question with this program. A knight in chess can move to any square on the standard 8x8 chess board from any other square on the boar...
[6 replies] Last: Without traps you could probably solve this analytically. With traps ... (by lastchance)
Finding Min/Max Value of an Array
 
Hello everyone, Hope this quarantine has been kind to you all. Please help with the following program... I am trying to find the minimum and maximum valu...
[1 reply] : First, please use code tags. See http://www.cplusplus.com/articles/jEy... (by keskiverto)
by frek
A vector of user-defined type
 
Hi all, Please consider this example: #include "C:\Users\...\std_lib_facilities.h" using namespace std; class A { public: //Constructor explicit...
[3 replies] Last: [quote=frek]Doesn't my code have appropriate tags now!? Looks like you... (by mbozzi)
Help: Stack
 
Hi. I need help pushing the values onto a stack. Once done, the number of elements should be shown on the first line and the value at the top of the stack on th...
[1 reply] : You have already a custom class and ask about loops and input? WHILE... (by keskiverto)
by frek
Cpp functors
 
Hi all, What does s in Less_than Lt{ "bakur"s}; in the following code mean, please? using namespace std; template<typename T> class Less_than { cons...
[17 replies] Last: (I reported that). And I reported you for abuse of the reporting sys... (by dutch)
infix to postfix formatting
 
So it is correctly converting infix to postfix just in a bad format for example when I put 55+8 it gives +558 instead of +55 8 how can I change this where would...
[5 replies] Last: Yeah, it's a real pain to get past that hurdle. I recently played wit... (by Duthomhas)
MISRA Coding Standard and Static Code Analyzers
 
If you care about the quality, safety and security of your software, MISRA and static code analysis might be of help. The article tells about what MISRA is, wha...
[no replies]
April 2020 Pages: 1... 45678... 10
  Archived months: [mar2020] [may2020]

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