General C++ Programming - September 2012 (Page 17)

by john22
A problem with STL list
 
Hello there, so I've created a code with STL list which works just fine Here is the code // here is main.h file #include <iostream> #include <iomanip> ...
[4 replies] Last: OH I spent 3 hours to fix it! I didn't know how small mistake it is! ... (by john22)
by gta100
Boolean variable calculation error?
 
Hello, everyone! I got really confused with the boolean results I got in my lines of code below, which states that 0||0 = 1. In my code, I have z = a||b, all of...
[5 replies] Last: Thank you! I see. You are right. I assumed that z is a sort of functio... (by gta100)
by nuju
Compound assignment within assignment
 
I came across this syntax in another person's C code: foo = (bar += 1); Is foo assigned the original or new (incremented) value of bar?
[1 reply] : foo would be assigned to the incremented value of bar if im correct (by Angeljruiz)
Simulate keystroke in command prompt
 
Hi, I have a problem with simulation keystokes for the command prompt. I have tried SendInput (http://msdn.microsoft.com/en-us/library/windows/desktop/ms6463...
[4 replies] Last: Hi Andy, Thanks a lot!! It works perfect with CreateProcess and the... (by Mister12345)
Using push_back for vectors
 
Hi everyone, I am having some trouble trying to convert the main part of my program to use vectors. Previously, I was just using ostream and ifstream to pas...
[6 replies] Last: Right, but I also have PhoneEntry Phone declared when the program star... (by paulr162)
Launch SnippingTool.exe from c++ program
 
I want to run SnippingTool.exe from C++ program. I have Win7 64 bit system. Following code does not work: CString exe = _T("C:\\Windows\\system32\\SnippingTo...
[1 reply] : Maybe there is an issue with file system redirection used in x64 versi... (by modoran)
How come second picture blits ok, but not the first pic [SDL]
 
Hello. I am using SDL. I'm here because asking about SDL related stuff because responses on the SDL forum seem to take weeks and I am sure there are some her...
[4 replies] Last: Works! Just when I think I understand if/else's....Thanks sooo much! ... (by dtaqee88)
Iterators
 
Hey everybody, I have 2 vectors - openList and closedList - Im trying to check if a item on the openList is on the closedList and if it is i need to delete it. ...
[4 replies] Last: JLBorges's comment about erasing after the debugmsg is also importan... (by Disch)
Maximum Sub Array Problem Brute Force
 
Hey Everyone !! :) I wrote a program for finding the maximum sub array using brute force technique using two methods. The first one is: void FindMaxSubArray...
[2 replies] Last: Ohhh.....i didn't see that. My mistake. I got it....thanks !! :) (by ChosenTorture)
Left and right shifting bits
 
Lets say you had a byte that had bits with values like this: 01110011 and you shifted each bit to the right by 1. The result would look like this: 0011...
[3 replies] Last: Okay, thanks. (by Flurite)
Books on Programming Algorithms
 
Hey Guys, I am trying to learn more about programming algorithms (the types used in programming competitions) and want to buy a well-rounded, comprehensive b...
[2 replies] Last: Data Structure and Algorithm analysis in C++ is a good book. Also, I ... (by MildewyTester)
Cross Platform Socket Library
 
Hello everyone! I'm new to the forum but I have used this site for its extensive C++ documentation reference for a log time now. Anyways, I just wanted to sha...
[no replies]
solved.
 
...
[4 replies] Last: Whoops that was just a typo on my end with the double colon it still g... (by snipejawnkid7)
by Xyexs
Help with else if statement!
 
Hi! !'ve been having a problem regarding the else if statement... line 15:head suspect #include <iostream> #include <ctime> #include <string> int main() { ...
[5 replies] Last: giving up... the user will say 1,2 or 3 instead... ;( (by Xyexs)
Help with if else if and else statements
 
help, i keep getting errors with this piece of code, if (playerSword = "WoodenSword") { playerMoney = playerMoney - woodensword; cout <...
[4 replies] Last: It worked! Thank you so much for this! (by helpforc)
erase not working in set
 
struct setcomp { bool operator() (const int &i, const int &j) const { return (arr ->size <= arr ->size); } }; set<int, setcomp> v; I have...
[5 replies] Last: To be able to store multiple elements that compares equal you can use ... (by Peter87)
need help, student
 
Im taking my first comp science class and am having some trouble understanding c++ I'm going through some hw now and ive been stuck on this question for a wh...
[2 replies] Last: yea thats the entire question and sorry for not placing it in the begi... (by jeckel7234)
by elgo
Functions in headers
 
I'm learning C++, and I'm working on a project. In this project, I need to call functions inside functions to allow navigation on a square grid. I have my funct...
[8 replies] Last: @CLman94, what Peter87 is saying is this. CustomHeader.h void IsThis... (by clanmjc)
by Disch
Can anyone spot the bug in this code?
 
Cookie if someone can spot it. I'm scratching my head. void MapBlock::trimDeadEnds( wall_t& wall ) { for(auto i = wall.begin(); i != wall.end(); ++i) ...
[4 replies] Last: > Guess invalid iterators are invalid even if you don't dereference th... (by JLBorges)
Undefined reference linker error
 
I made 2 class to make a single linked list MyHastList.h and MyHastList.cpp and its working perfectly following is the code!!!! ----------MyHashList.h---------...
[6 replies] Last: I second andywestken's suggestion, check that. Also, just for testing... (by clanmjc)
September 2012 Pages: 1... 1516171819... 32
  Archived months: [aug2012] [oct2012]

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