General C++ Programming - July 2015 (Page 2)

Optimized Binary Search
 
I was looking at some code for binary search and its optimized version on geeksforgeeks website. The following piece of code was provided Normal Binary...
[3 replies] Last: Thanks @JLBorges & @coder777. (by funprogrammer)
by c00012
vector subscript out of range...
 
I wrote a code to get two numbers which add up to the target. here's the code: #include <iostream> #include <vector> using namespace std; class Solution { ...
[2 replies] Last: thanks for the tip. It works. thanks you very much! (by c00012)
by homing
forceinline outside of class definiton?
 
Hey, Is it not possible to have a function declared forceinline_ and define it outside of the class definition. With the standard inline it works and it's rec...
[2 replies] Last: oh :) thank you! (by homing)
[HELP!] Unhandled exception
 
Hi guys! I made this topic becouse I have a problem and I think you guys can help me solving this. I've got a config file for my program where I set variables,...
[2 replies] Last: violation of access during the reading of the route A tip: if you wa... (by ecatron)
Encrypt a .txt file
 
Hey again guys, Been having trouble on how exactly do I encrypt a file. Been at it for a few hrs. Tried text book; doesn't help much. This is what I hav...
[4 replies] Last: You can try this code to encrypt a file #include <vector> typedef un... (by camycent)
Expert Help please
 
Can anybody help me correct this program ? there are 6 errors in this programs, i use my dev run and know the errors but i just dont know how to correct it. ...
[1 reply] : 1. Edit your post so that the code is in code tags. See http://www.cpl... (by keskiverto)
Copying a vector through constructor
 
I'm trying to copy another class' vector to cActionPuppet with the following code. (I apologize for any formatting issues, for some reason, the site won't let m...
[12 replies] Last: Ah, now I feel stupid. Thanks so much, sorry it took me a while to res... (by UglyIgloo)
The Standard Library
 
OK so I recently read an article on the art of DOOM 3's source code and so I decided to give it a look. Now when I did, I noticed something. The devs only use...
[2 replies] Last: Wow that was a much simpler answer than I expected. I understand thou... (by ForTheReallys)
by olette
Problem accessing StringOfcars
 
#include <iostream> #include <string> #include <vector> #include <fstream> //for file operations using namespace std; //Car class //Defined enum here...
[3 replies] Last: I got a bit confused by the lack of indentation. I see now that the in... (by Peter87)
by ham912
need help in making a program
 
Consider a,b,c as three arrays of size m,n,m+n respectively.array a is stored in ascending order whereas array b is stored in descending order.write a c++ progr...
[4 replies] Last: Got detaied answer? If yes pls post it here... (by neildenver)
How to add sentinel value in this program?
 
# include <iostream> using namespace std; int main() { char operation; float num1,num2; cout << "Enter operator either + or - or * or /: "; cin >> opera...
[2 replies] Last: I'am so sorry. I will not do it again. how can I use it again, select... (by mightyjack)
by anhnha
Event interrupt in C++ (Visual Studio)
 
I am using a PC based software (MFC app) for image processing. The software uses serial communication to communicate with other devices. Now I want to use event...
[1 reply] : I think you're looking for 'overlapped' reading. See: https://msdn.mi... (by coder777)
by olette
Program error?
 
This code #include<iostream> #include<string> #include<vector> using namespace std; //Car class class Car { private: string reportingMark; int car...
[1 reply] : Your program crashes on line 175 -> 141 -> cars is NULL. Nonetheles... (by coder777)
Lyric search program
 
I have to create a program that reads a file with song lyrics and allows user to search for songs containing certain words. - Reads the file lyrics.dat - Needs ...
[1 reply] : Line 22: inSong is not a global array. Line 30: You cannot define a ... (by coder777)
Problem of new Object within a Class
 
#include <iostream> #include <string> #include <list> using namespace std; class Type{ protected: int id; string name; ...
[2 replies] Last: found the solution myself: #include <iostream> #include <string> #in... (by manpakhong)
C++Noob problem
 
Hey guys I have been at this for a while and I keep running into trouble on verifying if a number is contained within a given string. Could you guys please ki...
[3 replies] Last: THANKS GUYS! You guys were of great help! Life savers! (by closed account 9G8MoG1T)
by mnm71
how two vector to join together?
 
In this program class Sensor get two value as sn & temp,each Sensor is a Network and two Network join together is a Region,when I join two Network I get std::ou...
[2 replies] Last: I think you say true thank you.... (by mnm71)
Please Help! Im writing a code and cant find where my error is.
 
hi im new to programming and im working on my homework assisgnment but i keep getting compiling errors: prog5.c: In function ‘int main()’: prog5.c:24:44: e...
[3 replies] Last: Hi, That's better :+) Lines 24 & 25 are meant to be function declara... (by TheIdeasMan)
boost library graph + serialization problem
 
I am using boost graph library. I can serialize the graph successfully. But when deserialized a graph from the file, an unsupported version exception was th...
[no replies]
by yj1214
What location does MinGW search when I use <>?
 
#include <something.h> I downloaded a library and it cannot be included with local path "" due to the library's include path structure. So, where does Mi...
[2 replies] Last: There is a good amount of debate on how to do this kind of thing on Wi... (by Duthomhas)
July 2015 Pages: 1234... 15
  Archived months: [jun2015] [aug2015]

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