General C++ Programming - March 2019 (Page 7)

Graph components C/C++
 
Hello. I want to count the components in a graph, but something is wrong with my C++ program - the output is sometimes right, but sometimes - wrong. Please help...
[1 reply] : So is your test case an example of when it works, or when it doesn't w... (by salem c)
looping assignement
 
hi I'm new in using c++ and it is major course in my school, now I have a assignment about loops and it goes like this I have no idea how to start Write a...
[3 replies] Last: > how do you code that ? Read a book. Pay attention in class. This i... (by salem c)
expected unqualified-id before numeric constant
 
What could be the source of this compilation error? mathconst.hpp:2:14: error: expected unqualified-id before numeric constant const double M_PI = 3.14159...
[4 replies] Last: but that doesn't work in Visual Studio It works just fine in VS. Th... (by Duthomhas)
Homework Output Help
 
Hello, can someone help me. Everything works but the employee name output doesn't display as it should. What am I doing wrong? #include <iostream> #include...
[2 replies] Last: It should just display (by ashebynova)
Invalid Conversion from char* to unsigned int
 
I'm trying to compare the value of C against strlen(sn) and update C to the new length if it is smaller. I keep getting an invalid conversion from char* to unsi...
[2 replies] Last: Hint: sn is not a string, it is also not initialized in the code snipp... (by jlb)
console not returning expected number of characters in cin buffer
 
I am creating a console version of "Bull Cow Game". In the game, the user has a certain number of tries to guess what the secret word is. Every time they guess,...
[2 replies] Last: They pointed that out on Stack Overflow too. After they posted it, I r... (by vaderboi)
Why is semaphore called a signalling mechanism ?
 
Hi ppl :), I came across at many places[skipping references] that semaphores are a signalling mechanism and mutex is mechanism to ensure only one thread/proces...
[3 replies] Last: The use of the term semaphore in computer science is very old and pred... (by CABrouwers)
unique pointer
 
I made this code here: #include <functional> #include <iostream> #include "to_c_array.h" void to_c_array(){ } int main() { // Please note: this excerc...
[2 replies] Last: @jlb, no, they will all be set to 1 (although he should say 1 and not ... (by dutch)
Grading System Progaramming
 
I have trouble making my program my only problem rn is delete section and putting file handling in my program THis is my code down below.: #include<iostream>...
[1 reply] : I have trouble making my program my only problem rn is delete sectio... (by jlb)
need help bubble sort
 
#include <iostream> using std::cout; using std::endl; void bubble(int arr , int size) { /* need help here */ } void printlist(int arr , int si...
[1 reply] : #include <iostream> #include <iomanip> void swap( int& a, int& b ) {... (by JLBorges)
funtion that counts coloumn. (1,2)
 
I have this mtx file: %%MatrixMarket matrix coordinate integer general % 5 5 10 1 1 11 1 5 15 2 3 23 2 4 24 3 2 32 3 5 35 4 1 41...
[20 replies] Last: Some more ideas. #include <iostream> #include <iomanip> #include <ss... (by salem c)
How do I have the cin buffer only accept a specific number of characters? (1,2)
 
I want to create a variable that only is able to take a specific number of characters from user and then will discard the rest. Here is the function in question...
[29 replies] Last: Oh interesting. It is neat that C++ just will automatically stop takin... (by vaderboi)
Help
 
Write a program with a class that contains following data members • Id • Marks Create and array of objects of size 10. Create a function read() to ...
[no replies]
csv file reading
 
Hello guys I am a novice at C++, however I have this project for school. I am trying to read a CSV file using C++ visual studio and store each value into string...
[5 replies] Last: Parsing a CSV is a job for a finite state machine. Using an FSM makes ... (by dhayden)
by osan
appointment code
 
i have tried an appointment (one time, daily, weekly and monthly) code. can someone help me with the issues. Thank you so much. //main #include "Appointment...
[3 replies] Last: I think you need to step away from the code for a few minutes and thin... (by dhayden)
Postfix to Infix Conversion with multiple digit integers
 
Hello, I'm currently working in a c++ program that computes postfix expressions and then converts the postfix expression into an infix expression. I've been doi...
[6 replies] Last: Nice. It seems the brackets in the infix notation are not dependent on... (by MikeStgt)
How to find the second Tuesday in October of a given year in C++?
 
For example, given 2019, October, return 12 since the second Tuesday on October 2019 is 12th. I know how to do it in java. I want to implement it in C++, but I ...
[4 replies] Last: #include <iostream> #include <ctime> using namespace std; const char... (by lastchance)
by Fadey
class virtual function but no overload instead stack calling ( constructor like behavior )
 
Not really good at making titles. class deep{ deep(){ cout << "deep()" << endl; } void stackTrigger(){ cout << "stackTrigger() - deep" << endl; } } ...
[5 replies] Last: If you always want to call deep::stackTrigger(), no more, no less, no ... (by Peter87)
by roses
Compiler gives no errors, yet it doesn't continue past a certain point when I run it
 
idk what im doing wrong here. so here's the problem Write a program that accepts as input: The loan amount The interest rate per year The monthly...
[8 replies] Last: You keep decreasing the payment. Eventually it drops to zero, then it... (by dhayden)
March 2019 Pages: 1... 56789
  Archived months: [feb2019] [apr2019]

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