General C++ Programming - July 2014 (Page 14)

Check for (improved) winning moves
 
For starters, this is NOT homework. I like programming for fun, and I am almost 64 years of age. Now, on to my problem.. I wrote a 'Connect Four' game, and r...
[5 replies] Last: @Smac89 That worked beautifully for the rows. I'm now tweaking it for... (by whitenite1)
Help using Regex
 
Hi, LeafyCircuits here! Comp Specs: OS: Windows 8 64-bit IDE: Code::Blocks v13.12 Compiler: TDM-GCC v4.7.1 (MinGW) I've had a recent need f...
[7 replies] Last: Ah, sweet. I'll update my GCC as soon as I get home next week. (by Duthomhas)
External component randomly throwing an exception
 
So I've been working on a certain project for quite some time, and it's starting to get really annoying because I can't get it to work for more than one day at ...
[2 replies] Last: Well I'm working on code that I had no part in writing originally, and... (by nboch12)
expected primary-expression before "int"
 
Hi. The error is: 27 G:\Test_suite\HW2_Hooshdaran.cpp expected primary-expression before "int" and the program is: #include <iostream> #include <io.h> #inc...
[6 replies] Last: The important thing is that the compiler identifies the line and point... (by Chervil)
infinite loop?
 
Hi. Why cannot I find the number of occurrences of "<context>" in the character string held by char buffer and it seems to fall into infinite loop? ...
[2 replies] Last: Yes Peter, I did it, and it worked!Thanks! (by hooshdar3)
friendship from derived class method to base class members
 
I would like to know if there's a way to make a method from a derived class a friend of its base class. Something like: class Derived; class Base { i...
[3 replies] Last: That is not an ideal solution, what they came up with is such an ugly ... (by closed account 10X9216C)
reference
 
hai programmers, i am new to this forum, and i am looking answers for the listed below questions. 1) how are class members are referenced with example ? ...
[2 replies] Last: Yep just like Mikey said, re-read c++ reference also you can use the t... (by Uk Marine)
RC4 with ULE-frame
 
Hi, I want test secured ULE with Opensand platform. Here is Opensand source code listed below for generating RC4 cipher. This code should observe protocol giv...
[no replies]
arrays
 
main(){ int person ={1,2,3,4,5,6,7,8,9,10}; int number ; int temp = 0; int value = 0; cout<<"Enter the number of pancakes eaten by person "<< person ...
[5 replies] Last: You could just make a variable like int index = 0; or use value sinc... (by BHX)
Count characters, vowels, consonants, etc.
 
Please help! I am extremely lost as I had to miss several classes for an emergency and am turning to the cplusplus world for help. In this assignment, you must ...
[2 replies] Last: This isVowel function has less code and does the same thing: bool is... (by Smac89)
Help! srand (time(0)); not working-- Random color picker
 
I have to write a program that selects a random color from an array. I used the srand (time(0)); statement but it still gives me the same color each time. Does ...
[7 replies] Last: I used the srand (time(0)); statement but it still gives me the same... (by cire)
Algorithm producing wrong output
 
Can anyone tell me why my calculate function is producing a zero?I feel like it may have something to do with there being zeros the arrays it takes, but i can't...
[1 reply] : You are using uninitialized data. M = new int[pouch_size + 1]; just... (by ne555)
Integer to String
 
So, I've managed to do this far and almost, almost done except for this one problem. The output should be -- CAR = Toyota but instead I got this CAR = (2,3). ...
[4 replies] Last: C++11: #include <string> int x = 72; std::string s = std::to_strin... (by Duthomhas)
string
 
Hi. How does 'string' differ from 'String' and 'const char *'?
[2 replies] Last: A 'const char *' is just a constant pointer to the memory location of ... (by Yay295)
Question about the term: "Translation Unit". Help me sound smart!
 
So this term, Translation Unit, has been coming up in my reading more and more often, either that or I just haven't noticed it before. I understand what it is i...
[4 replies] Last: @ jlb : Yeah, it's that second quote you have that threw me off, alon... (by Computergeek01)
open a thousand .dat files for input operations
 
Hi! I would like a piece of advice about a program that I'm writing: First part (that I can manage myself): I've to call an input file.dat, a column of int n...
[12 replies] Last: p.s. the program (finally) works, the problem was the memory freeing (... (by Foxfire)
Rectangle class width/height problems because of floating point errors
 
Hi, I'm trying to write a game and for that I created a class to represent a rectangle for bounding boxes and similiar things. I already had tons of problem...
[10 replies] Last: I just rewrote my code to use width and height instead of right and b... (by MikeyBoy)
by xystus
A string array... with more than 1 string?
 
How would i do this? Im trying to create an inventory but this just will not work, when i do it how i have it originally (as shown below): cout << "Do...
[8 replies] Last: To answer your earlier question about vectors, not having to know the ... (by Computergeek01)
by newww0
generating integer array
 
Hi,i am new to c++ and i want to write a programm to generate an integer array. I keep getting the error at line 25: invalid types 'int ' for array . can anyone...
[2 replies] Last: What compiler do you have ? No modern compiler will let you compile t... (by modoran)
splitting a string in c++
 
with respect to below string, i need to split it and store the values accordingly as below, P2P-DEVICE-FOUND fa:7b:7a:42:02:13 p2p_dev_addr=fa:7b:7a:42:02:13 ...
[6 replies] Last: Use something like this if your compiler does not support c++11: #inc... (by modoran)
July 2014 Pages: 1... 1213141516... 26
  Archived months: [jun2014] [aug2014]

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