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

by Kalcor
Bitmasks
 
Can someone kindly explain to me what are bitmasks exactly used for? I read about them on wiki, searched a few topics but my poor brain just can't understand t...
[8 replies] Last: The communications protocol we were using was for vehicles. say a mess... (by jonnin)
by Kalcor
Minimax algorithm
 
https://i.stack.imgur.com/PCAPQ.jpg Hello, This image above, is kind of vague to me, it was from a MIT lecture about minimax with Alpha/Beta pruning now I ...
[6 replies] Last: Thanks <3 (by Kalcor)
Why My Tic Tac Toe is not working.
 
#include <iostream> #include <string> using namespace std; const int raws = 3; // this many raws in the board const int columns = 3; // this many ...
[1 reply] : What are the error messages you are getting? (by closed account D9T7Djzh)
Cell phone tower capacity
 
Sorry this is long but I am almost finished with this assignment and just cannot finish the last part. I have all the signal strengths in an array such that: Th...
[no replies]
by yrawat
test aray
 
Study Observing Variables feature of MSVS described here. As you work on the below project, demonstrate to the instructor displaying local variable values with ...
[2 replies] Last: The main function is as follows and our code should work properly with... (by yrawat)
by ISM34
Traveling Salesman Problem C++ Code Issue
 
The following code is an algorithm I designed to solve the Traveling Salesman Problem. I am using a Nearest Neighbor Algorithm to find an optimal path and cost ...
[no replies]
C++
 
Ive got this code but it won't run and i can't find any more errors int main(){ int *p, i, a ; p=a; for (i=0; i<10; i++) scanf("%d", p++); printf(...
[5 replies] Last: You need to reset your pointer to the beginning of the array. Also it... (by Thomas1965)
Lexical Analysis/getToken() Question: Simplified
 
This question resides within a lexical analysis program: I've been working on a member function Token getToken(): each call to this function is supposed to ret...
[1 reply] : Line 26 needs to return the token type Line 56 looks wrong to me. If ... (by dhayden)
Bit Array operator overloads
 
Hello all there is a program that I am writing and it requires me to define these three friend functions. friend ostream& operator<< (ostream& os, const ...
[4 replies] Last: operator != is easy: Implement it with operator==(): bool operator !=... (by dhayden)
Asio read queue
 
I needed to asynchronously read n bytes from the tcp stream in asio, but I couldn't find any appropriate api, so I made my own solution that uses a byte array a...
[4 replies] Last: That may be the case. I haven't had much experience with the api at th... (by zoran404)
Sieve() function
 
hello all, I was wondering if i can get some assistance with the Sieve algorithm. I have to make a bit array class that prints a array of bits in binary. But wh...
[1 reply] : https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes (by closed account 48T7M4Gy)
Disable Run-Time Check Failure #3 for a method
 
I have some code that's triggering Run-Time Check Failure #3, but the variable should be assigned before use. code: typedef const char *Id; Id dialogueParent...
[2 replies] Last: Turns out I just needed to map a comparator for const char * to dialog... (by zerophase)
Need help completing this switch statement in my code
 
Basically, I am supposed to create a program to add, view, remove and update products. However I have only been able to successfully implement add and view. If ...
[3 replies] Last: If you solve your problem, please do not remove your topic. http://www... (by mbozzi)
Help! tic tac toe program
 
Need help... not figuring out the winners to my tic tac toe program code below //This is a program that will aloow the user to play a game of tic-tac-toe //Ahm...
[8 replies] Last: my bad... i figured it out anyways thanks to this site! (by iosgaming700)
What is wrong with my if-else statement?
 
if (win1 == true) { cout << "Player x won" << endl; xWin++; } else if (win2 == true); { cout<< "Player o won" <<endl; oWin++; } else//e...
[2 replies] Last: wow thanks (by iosgaming700)
Please Help Getting Errors
 
Hello. im creating a program that determines payroll and im getting problems debugging it can someone help point out the reasons why im getting errors. Tha...
[no replies]
Comparing integer and pointer
 
I am writing code to compare a zipcode integer input (int z) and the zipcode of the input ZNode object *n. When comparing them I keep getting error of comparis...
[1 reply] : need to see the variable in the class also. Is it a pointer, do you n... (by jonnin)
BitArray Organization and Manipulation
 
Hello all I am assigned to make a bit array class and I would like some assistance on some definitions of the class. I need to make a Set(), Unset(),Query(), an...
[10 replies] Last: #include <iostream> using namespace std; #include "Header.h" int m... (by markymark99)
How to pass a dynamic array of objects as a function argument? (
 
What the function outputs is not the matter at hand. I will not use double pointers, so go ahead and show me how to use references to pass arrays. The functio...
[1 reply] : Go ahead and show me how to use references to pass arrays. Fundament... (by mbozzi)
How to code circular int?
 
Hello. Whats the best way to code circular int? So for example I have int red_color = 255; and if someone initialize red_color = 256; it will be changed to 1...
[2 replies] Last: Thanks! (by Putarda)
April 2017 Pages: 1... 45678... 16
  Archived months: [mar2017] [may2017]

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