General C++ Programming - August 2011 (Page 8)

by mecca
compiler optimization and reference vars
 
Hi. I often use reference variables to rename my longer, global variables. e.g. double& X = SomeLongVariableName; result = -X*X + X; Is this a ba...
[5 replies] Last: does your "bad programming style if using global variables" include g... (by Athar)
comparison failure with string with special characters
 
I have used char *var = ".x_t"; int iIsValid = _stricmp(var, ".x_t"); Here I am expecting comparison result to be 0,but for var with value ".x_t" returns 32....
[3 replies] Last: MSDN have an entire page dedicated to _stricmp( ) . References: ... (by closed account zb0S216C)
About pointer
 
Hi all, I'm very new to C++ programming, I read the tutorial about pointer, and there are some questions pop up in my mind that I would like your help. These...
[9 replies] Last: What I like most about them is doing cool stuff like self extending da... (by ZED0815)
Random name generator.
 
Any ideas on how to go about doing it? Maybe a large array with every name in? (That'd sure be a bitch to write out).
[3 replies] Last: Don't have access to a database with names in, I was hoping there'd be... (by Theo Paphitis)
Snake Problem
 
Hi! I was trying to create a snake program in c++ (i'm using devC++ environment). I had already initialized the snake. But I have no idea as to how to mov...
[4 replies] Last: I like SDL library, it's really made from developers for such... even ... (by ZED0815)
How to run C++ program that use PDCurses on other computers?
 
favorite I've recently started using PDCurses in a C++ game I'm working on. When I compile the program on my own machine (windows) and run the .exe, every...
[no replies]
expected class name-name before '{' token.
 
I think this error is somewhat infamous, yet searching around hasn't really revealed much to what I'm dealing with. Total newbie to c++. /* * File: ...
[2 replies] Last: This may also be caused by a circular inclusion issue with your header... (by ModShop)
Strings - Search a string pattern from a file & write to new file with formatted
 
Hi All, I am still new to C++ & I have this question & I hope I can find an answer here. I have the below in a file (captured from a directory list to a...
[no replies]
I Need C++ Help
 
I have another problem with a game I'm making, here's the part of the code where it goes funny: if (age >= 18) { //cin.i...
[13 replies] Last: And have only been practicing for about 3 months. (by closed account 967L1hU5)
How to use C++ code in C#.net
 
Hi all, I found an article in MSDN which describe how to do some certain thing, http://msdn.microsoft.com/en-us/library/ms919833.aspx but it is in c++. I wan...
[2 replies] Last: It sems that function you link to -- RequestPowerNotifications -- is n... (by andywestken)
Functional XOR Encryption
 
Hi Everyone, So I've been "inspired" by some posts recently to try my hand at breaking the encryption methods, but before I do that I need a functional wa...
[4 replies] Last: THAT'S WHAT I NEEDED! I had the output file opened in truncate mode so... (by Computergeek01)
Class Templates, Linked Lists, Print Functions, Need Help?
 
I am using Class templates and Linked lists to read and write to a .txt file. I have the code down to where it will compile but i'm not sure what to do within t...
[1 reply] : In this code, void PrintGradeReports(ofstream &outFile, linkedList<Pe... (by tition)
Help with classes
 
Im making a pokemon game and i ned to use the "charmander.basehp=65" in the equation for the health stat in "void pokemonshealth()", how would i do that? class...
[9 replies] Last: You should be able to call the function after making the assignment: ... (by closed account D80DSL3A)
Admin Help Me or someone who is skilled enough. (see code inside)
 
#include <iostream> #include <cmath> using namespace std; typedef string ActType ; int main () { ActType act; int numOfact; int ET; cout<<"Ent...
[1 reply] : It seems to me that you have a bunch of scope issues, that is to say y... (by Computergeek01)
Error:Vector out of range using Class Template
 
I have found where in the program it is giving the error but can not for the life of me figure out why, can anyone help. I am getting a debug assertion failu...
[2 replies] Last: Thanks, I figured it out, it is obvious, oh well it usually is. (by SUPERFLY)
by Catt
Summing irregular area of an array
 
Hey everyone, I have a 2-dimensional array, such as this: int grid ; The contents of which look like this: 1 1 3 2 0 0 1 0 2 1 1 1 0 3 3 3 0 3 1 0 2 2 ...
[4 replies] Last: Oh sorry! I was going to make the sample array 6x6, but I was too lazy... (by Catt)
by andy8
Please help me with the 'logic' of this program
 
Hello All, The question that I am attempting to work out is as follows : "A government research lab has concluded that an artificial sweetener commonly u...
[1 reply] : Yes, it's right. But it doesn't take 104000 cans to kill the dieter, i... (by JellyFox)
Partially specialized template inherited by normal class. (multiple definition of ...)
 
Hello everyone. This is my first post on this forum. I have a huge problem with inheritance a partially specialized class (one method depends on type). My code...
[2 replies] Last: Your answer is very clear for me, thank you for quick reply. I was alm... (by Marek Kijo)
by siloan
Fopen in a for
 
Hi there, i'm trying to generate some .txt files through a for but i have some problems doing that- int i; for(i=0; i<10; i++) { FILE *t =fopen("file ...
[5 replies] Last: Thank you guys! (by siloan)
storing Keys::*** in array
 
Hi There, I am creating a c++ .net program which needs to check which button on the keyboard has been pressed. My ideal way to do this is to use an array to...
[7 replies] Last: haha! You're a legend! It works perfectly! hmm, you have no idea how m... (by disjuku)
August 2011 Pages: 1... 678910... 29
  Archived months: [jul2011] [sep2011]

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