General C++ Programming - March 2016 (Page 16)

Encapsulating third party api
 
I was wondering how I could put some abstraction between winapi and winsock and my code. I want to make a tcp socket class, but I keep ending up with private va...
[1 reply] : Creating a wrapper class in a new header solved the problem. #inclu... (by drowsysaturn)
Quicksort with Median of Three
 
Hello guys I am having trouble compiling this code using the Quicksort function and the median of three. Can someone look at this and see where my error is at, ...
[no replies]
Master dev C++ please come!
 
I hve a problem, There is the question 1/1^2 - 1/2^2 + 1/3^2 -1/4^2 + ... the formulla is given limit varible < 0.000001 can be ignored please search the t...
[2 replies] Last: Pretty close, but to fix what moschops said and to solve the problem o... (by drowsysaturn)
changing an if statement to a while loop
 
I have some code where I've created a maze, and there is an if statement followed by a goto to get back to the level menu after finishing a level. However, I wo...
[1 reply] : You would have to surround all of the code that includes the switch st... (by drowsysaturn)
closing a program whenever the user cares to do so.
 
i am trying to right a program where whenever the user inputs exit the program will close. so the user can exit the program no mater where he is at in the prog...
[3 replies] Last: When you are comparing a std::string and a char*, do exit.compare("... (by drowsysaturn)
by Strakh
Synthetic Division Program Being Weird?
 
I am writing a code to do synthetic division. I can not figure out why it isn't working. I also plan on translating this into BASIC-Ti. This is stressing me out...
[2 replies] Last: TermA is initialized, I moved it when I was testing something, forgot ... (by Strakh)
write a class called digit..
 
im having trouble with this program it would be great if someone can help me out with it Write a class called Digit. The class has a private member variable ...
[1 reply] : Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
C++ problem with strings
 
Hello, I want to know how to split a string in C++. In fact i want to do a program that do that: Write a program that reads a sequence of numbers and prints...
[4 replies] Last: istringstream works like cin, the difference is that the input comes f... (by Thomas1965)
..
 
.....
[no replies]
I/O transferring data from input file to output file.
 
I am having trouble with coding this program. I am learning I/O and I am supposed to read an integer from an input file given by the user and expect that intege...
[6 replies] Last: Ok I think I did it. hahah Sorry its my first time on cplusplus (by patoiscute)
Question regarding my code.
 
Ok, So I've exhausted every other resource before coming to this forum for help. I have a program that I am writing for my class. The program checks the net pay...
[5 replies] Last: i made taxrate = 0; on my program at home and it's still spitting the... (by jlb)
Why must main() return anything?
 
I've heard that "back in the day", the exit codes actually meant something. They were used to indicate whether or not a program had run successfully, or somethi...
[3 replies] Last: If "back in the day" means right now, right here, then, yes, that retu... (by MikeyBoy)
by a10e29
Object slicing trouble
 
Hey guys. Been having some trouble with object slicing, I am failing to understand why. please consider this <code> #include <vector> #include <memory> class A{...
[4 replies] Last: > pretending I made 3 cotainer objects and populated contents(...) ¿a... (by ne555)
Should I use delete when using this code.
 
for (auto const &element: setB) { if (c++ < setA.size()) { if (TESTING) { cout << element; } ...
[6 replies] Last: No, it's not good. It's a mess. This (const char *) '\n' creates a p... (by Moschops)
string count without counting spaces and character which is repeated
 
I made a code which can count length of a string in characters without space, But I want add an feature which count any repeated char as one, so Please help me ...
[5 replies] Last: I made this code: It counts repeated characters as 1, and doesn't incl... (by hiphop12ism)
by m0shka
Binary search algorithm
 
I am making a spellcheck program that compares words from a notepad file to another notepad dictionary file. I just need a bit of help in the binary search algo...
[1 reply] : Why are you returning integers? It makes more sense to return bool. 1 ... (by keanedawg)
C++ Matr
 
Ffjdjd
[4 replies] Last: This matrix code will serve my purpose. However, I am a beginner in C+... (by skalsi)
Object Oriented Programming Assignment Help
 
Hello, I am new to this website and was wondering if I could get some help with an assignment for a class. This is the assignment: -This is a database of empl...
[3 replies] Last: This is what I have so far: #include <iostream> using namespace std... (by mrbossjb)
Calculating Time complexity of a couple functions
 
Hi everyone! I just started the topic of time complexity and the usage of clock_t. Now let's say I want to calculate how long it takes for the compiler to calc...
[2 replies] Last: I am not entirely sure, but depending on what system you ran this on y... (by Nick Schuck)
infix to postfix
 
// // // // Copyright © 2016 Suraj Patel . All rights reserved. // #include <cstdlib> #include "stack2.h" #include<cctype> #include<iostream> ...
[3 replies] Last: I would like to point out you have no reason to make priority a double... (by keanedawg)
March 2016 Pages: 1... 1415161718... 23
  Archived months: [feb2016] [apr2016]

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