General C++ Programming - April 2017 (Page 15)

Linked List in C++
 
Hello there, I have a potentially stupid question. Here is a C code which creates a simple linked list with three nodes. Afterward a function called "printList"...
[4 replies] Last: You're welcome - glad it helped! (by MikeyBoy)
by Kewun
c++ expression must use a intergal or unscoped enum value
 
// dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" #include <stdlib.h> BOOL APIENTRY DllMain( HMODULE hModule, ...
[1 reply] : int ass = rand(); system("date "+ass+"-01-01"); How could it work... (by Thomas1965)
request for member error
 
here is the error In function ‘void get_line(std::ifstream&, std::ofstream&)’: lab11new.cc:49:17: error: request for member ‘at’ in ‘line.std::__cxx...
[7 replies] Last: thats the thing i think they appear multiple times because i have to g... (by mikeal200)
Problem with const function
 
Hello++, I'm trying how make a member function const. The code compile OK if the function is not const. myclass.h: ---------- struct my_data { int iVal; ...
[2 replies] Last: Thanks! :) (by coredumped)
How do I write to and read the elements of THIS dynamic array of objects?
 
I have 3 files. 1 main, 1 Player.cpp (Which I fill through asking the user how many instances of it they want, as you can see with the dynamic array) and 1 Play...
[8 replies] Last: The size of any given block of memory is not variable -- this seems t... (by Beyond Humanity)
Recursive Minesweeper
 
Hello, as the title states, I am trying to code a recursive minesweeper game. I feel like I have the general idea down, but I am having trouble with implementat...
[no replies]
Find biggest number out of 4 numbers. Program is not working.
 
#include <iostream> using namespace std; int Highest(int num1, int num2, int num3, int num4); int main() { int num1, num2, num3, num4; co...
[1 reply] : #include <iostream> #include <algorithm> // return the highest of a,... (by JLBorges)
unique_ptr memory compress
 
#include <memory> #include <iostream> int main() { auto deleter = (int* ptr) { delete ptr; }; std::cout << sizeof(int*) << std::endl;//4 std::cout ...
[2 replies] Last: thanks! (by Wu zhen hai)
MPI Problem
 
#include "stdafx.h" #include <mpi.h> #include <stdio.h> #include <iostream> #include <fstream> #include <string> #include <cctype> #include <cstdlib> #...
[7 replies] Last: @lastchance I was successful with my intentions. #include "stdafx.h... (by HumbleAAT)
Function call error Help!
 
function is: void disp_database(Part database ) { int i=0; for (i=o;i<SIZE;i++) { cout<< database .partNum << ' '; } return; } struct Part { int partNum; ...
[2 replies] Last: so i changed it to int disp_database(Part database ) im still gettin... (by iosgaming700)
by Kmpck
Image management code issue
 
Hi guys. Having a bit of trouble here with some code for working with images. I will first say that this does involve using OpenCV so if this is not the plac...
[1 reply] : cv::mat srcMat = cv::imread("C:/Users/Kmpok/Desktop/images/baboon200.... (by ne555)
Dequeue Is not functioning well
 
Hello Guys, I'm new to this awesome helpful site. I've been watching alot of tutorial on Queue array implementation and read a lot of answer. But could not find...
[1 reply] : You keep track of both front and back index so I assume you are trying... (by Peter87)
Mistake when writing an object from another one
 
Hello, Here is my problem : I have 2 classes in my program. The first one builds an object A with 4 members variables. The second one builds dynamically an obj...
[13 replies] Last: Ok, I tried but it didnt work :( That's because you didn't try the c... (by dhayden)
Is using the 'extern' keyword often bad?
 
I was finding myself using the extern keyword quite a lot these days (mainly from laziness). I expect it to increase the compile time since it's more work for t...
[3 replies] Last: Thank you for your answers, I just have some global control variables ... (by Golden Lizard)
Help with program
 
I have this program that I made but for some reason I cannot get the program to reject any number below 1. Also I want to make sure I have at least an array, lo...
[5 replies] Last: Keep in mind that this is C++, not C, so you can declare your for loop... (by goldenchicken)
Wrong output in function
 
Hello, this function(ratethegroup) is giving me the wrong outputs when entering numbers. The function receives 4 numbers, total of 3 scores and the 3 scores. Th...
[2 replies] Last: also take a look here, seems similar/same problem: http://www.cplusplu... (by gunnerfunner)
for loop
 
hi all i have been given this for loop for (int i = 1; i <= n; i++) if (i < 5 && i != 2) cout << 'X'; the question instructs that the segment sh...
[3 replies] Last: thank you! (by halleyc)
Large stack use-Coverity issue
 
I have used local std::stringstream in my funtion which stores huge data in it. When i run Coverity Desktop analysis, i'm getting "Large stack use-Coverity issu...
[11 replies] Last: It means that the string has a fixed length 16-byte buffer for stor... (by dhayden)
Ofstream/Ifstream help
 
Hello all, I have finished my program, but when I try to use ofstream and ifstream in order to print my output onto a different file, I either get errors or jus...
[1 reply] : If I understood correctly, then it works on your original file, but no... (by Golden Lizard)
Summary of changes between C++14 and C++17 DIS
 
Brief summary. Contains links to ISO documents having the details. Does not incorporate changes arising only from resolutions of defect reports. https://isoc...
[no replies]
April 2017 Pages: 1... 13141516
  Archived months: [mar2017] [may2017]

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