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

by Borneq
How to subclass thread?
 
I try class MyThread: public thread { MyThread(_Callable&& __f, _Args&&... __args) : thread(__f, __args); }; but is error. If I don't must subclass...
[no replies]
Unsure How to Declare Winner in Array After Sorting
 
Hello, thank you in advance for any help. I have a code that asks for the scores between two teams stored inside a double array. After I find the scores I need ...
[1 reply] : I ended up using a different sorting mechanism to find the answer, and... (by fsm0019)
change char to asterisk(*)
 
Im just new to c++ and we are making a program that changes the text into asterisk (*) like on what we get when logging in on a website. please help! thanks!
[3 replies] Last: That's a sample: #include <iostream> #include <string> #include <ioma... (by Kalcor)
pixel detection and tracking
 
hi i am wondering at first, if you can use pixel detection in c++, and also pixel tracking.(if so what library to include.) so what this program does, is its pa...
[1 reply] : c++ can do anything that can be done on a computer. The library depe... (by jonnin)
Error in program
 
This is the program I am working on but when i debug it, I get an error which says,"error C1075: end of file found before the left brace '{' at 'Tic Tac Toe.cpp...
[2 replies] Last: Hi i work on your code and apply some improvements on it. this work... (by eec)
INCORPORATE IF ELSE IF STATEMENT INTO WHILE
 
I need to incorporate an if else that only add points if they are good else make them enter again. Can someone please help me with this? //This program...
[1 reply] : Please do not double post. http://www.cplusplus.com/forum/beginner/21... (by AbstractionAnon)
Just need to see if in the right direction.
 
Hello I was wondering if anyone could help me with my program. I am tasked with writing a spell check class that will take a string and check a set of strings t...
[8 replies] Last: You could run it from a terminal window and give the input via the key... (by dhayden)
How to do a case insensitive search for strings! I need to be able to type lower and uppercase letters. This is my code so far:
 
// Search the stock's index given a symbol int searchStockBySymbol(int numStocks, string *stockSymbols) { bool found = false; string symbol; cout << "En...
[7 replies] Last: Modify the 'Perform a search' part as follows: /****************... (by JLBorges)
How can I return a constant string array(Which is two-dimensional), in a function defined in a header file?
 
I managed to return a string array in a function, but not a constant array; I WANT to declare my array as constant as the element values will NEVER be changed ...
[1 reply] : #include <string> constexpr std::size_t NROWS = 3 ; constexpr std::s... (by JLBorges)
Populating Vectors with Random Numbers
 
Hello! So I am trying to populate 3 vectors with random numbers, but it keeps generating 51 as my random number and no others. I am not sure what I am doing wr...
[3 replies] Last: int b = rand() % 100; should not be at : int main() { int b =... (by Beyond Humanity)
by Kalcor
Searching and storing
 
Hello, I am creating a program that's supposed to take input from the user in the form below and output it in a certain style and this involves storing the vari...
[1 reply] : Use dynamic arrays if you can't use std::vector: #include <iostream... (by gunnerfunner)
by Kalcor
Pointers and const
 
Hello, I am a bit confused with these couple lines of code: constexpr int null2 = 0; int *p5 = null2; cout << *p5 << " " << null2; Gives me the error: ...
[1 reply] : What behavior do you expect and why? The compiler explained why the fi... (by Cubbi)
end my program if other is running
 
Hello guys, can someone here help me or tell me how do i make my c# injector exit when windebugger is running?
[no replies]
parametrer signature of function pointers
 
Does someone know how the signature of a function pointer looks? I need that for passing a function address as an argument. Here is my non-working attempt: d...
[2 replies] Last: Thank you mbozzi! (by nuderobmonkey)
stack/heap... let me know if I'm right
 
Given this code: void myFunction (int * a) { *a = 10; } int main () { int *b = new int; *b = 20; myFunction(b); } Am I right to think t...
[6 replies] Last: Good to know - thank you. (by mbozzi)
i need assistence finishing the C++ problem
 
here is the problem Write a program named FileIO.cpp. In your program, open the input file in.txt, check to see if it opens successfully, and then read the ...
[3 replies] Last: I think the part you're missing is that your program should not create... (by dhayden)
ERROR 2019
 
Hey, I have multiple errors related to my code source and i don't know how to correct them. In this project, i need to put each fonction in a .cpp and their h...
[3 replies] Last: All of the *.cpp files (and optionally header) must appear in the 'Sol... (by coder777)
by Kalcor
Top level and low level const-s.
 
So there is something I read in C++ Primer that's confusing me, basically it said "We use the term top-level const to indicate that the pointer itself is a con...
[8 replies] Last: > I've never heard the term "top level const" The term that the stand... (by JLBorges)
Why is my timer not working?
 
Hi, I have been making a maze based game over the past few weeks and i wanted to implement a timer into the game level, so the player can keep track of how long...
[1 reply] : #include <iostream> #include <chrono> struct timer { void reset(... (by JLBorges)
Please Help!
 
This is the error! expected 'while' before '{' token The code: #include <stdio.h> #include<stdlib.h> int main() { int n, i, op, cont, contAp=0, cont...
[1 reply] : you have a do while loop with no while.. (by SamuelAdams)
April 2017 Pages: 1... 910111213... 16
  Archived months: [mar2017] [may2017]

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