General C++ Programming - December 2013 (Page 7)

Modifying game lobby
 
I was trying to modify Game Lobby coding so that the output can save the information into a txt file. However, i was able to save it into txt file, but I don't ...
[no replies]
solving Quadratic equation.
 
I've seen the example of solving quadratic equation. [a^x^x + b^x +c = 0]. from http://www.cplusplus.com/forum/general/36313/. It work on real solution. is ...
[3 replies] Last: yes. switch(((b^2) - (4 * a * c)) >= 0) { case true: { ... (by IWishIKnew)
Referencing something from a Unique Pointer
 
I'm fairly new to coding c++ and am trying to make a Text based RPG. I've been working at it for awhile, and i'm not sure what to do. I'm trying to make it so t...
[no replies]
Problem with my program
 
Hi everyone so heres my program the problem is that it only allows me to enter my x and y coordinate and then terminates. Heres the directions and the program t...
[1 reply] : It doesn't wait because your not telling it to. You're setting x and y... (by xismn)
Inheritance: Conflict resolution
 
So, say an object has onperator++ what if I want an object that inherits that operator to do somthing on top of what it already does. example: class...
[6 replies] Last: alrighty. (by IWishIKnew)
Frazzled by these peculiar pointer behaviors!
 
I have been learning C++ by myself and have made significant progress. I need some insight/help however relating to the use of pointers in the application outli...
[5 replies] Last: re: pointer style It isn't a matter of style, it is a matter of what y... (by Duthomhas)
Issue with cout for a char array. Appearance of weird character
 
I used the following code to reverse a char array (string). String itself is reversed but at the end of the string there appears an unusual character. This char...
[6 replies] Last: Um... In your example, you are having a buffer overflow, which will oc... (by TwilightSpectre)
What's wrong with my code?
 
Hello! This is my first post and I am wondering, what's wrong with the code written below? I get an error message that says "R6010 -abort() has been called" ...
[3 replies] Last: @dawoodr: That's exactly what he meant. To access the first item, you ... (by S G H)
Representing entities with MI
 
I'm trying to make a space shooter and I want to make the code very reusable. So far I've been making a bunch of objects with multiple inheritance like this: ...
[6 replies] Last: Oh, I see! That's a lot clearer. Making the diamond graphics helps too... (by pivottt)
Clearing stringstream
 
Hi, How do I clear a stringstream. I have tried this site and others and have not found anything that works. I am making a tokenizer for a "fun" programming lan...
[3 replies] Last: #include <iostream> #include <sstream> #include <fstream> std::istri... (by JLBorges)
Vector member functions messing up
 
I am making a game, and I have a vector<string> equippedArmor in class character. One of the member functions of character is character::recalcStats, which loop...
[10 replies] Last: equippedArmor used to be a vector, I then changed it to an array to av... (by TsarLenin)
Can anyone tell what the error because I cannot get the output.
 
Write a program that read from the screen a list of 5 integers values as one dimensional array by using a loop. The main program should called the function int ...
[1 reply] : Your code has so many errors to point out individually. If i understan... (by quine)
Nooby question about free
 
Hi , can free function be used without malloc? That is , Student *ptr = stdList->head ; ... free(ptr); the code above is correct? ...
[3 replies] Last: I'm assuming that he's using C since he referenced C functions, and nu... (by closed account N36fSL3A)
my game code requires correction.
 
Game between the two students studying quadratic equation solution. 1.In each round the first student gives his friend to solve a quadratic equation he writes....
[1 reply] : Please enclose your code in the brackets as shown below. You can do th... (by heyyouyesyouiloveyou)
Reverse of a string
 
Hi, If I am executing following code after reversing it is giving "1" but I need "0001". #include <stdio.h> int main() { int n=1000, reverse = 0;...
[11 replies] Last: well, I would say you need a for loop: string whatever("Hello World!... (by IWishIKnew)
Whats Wrong with the fraction part
 
#include<iostream> using namespace std; main() { float f; cin>>f; f -= int(f); cout<<f; } Input 12345.12345 Expected Output 0.12345 Outpu...
[5 replies] Last: wikipedia is fairly detailed. float: http://en.wikipedia.org/wiki/Sing... (by Cubbi)
by LeoJet
Help
 
I am writing a program wich read a file of more 3000 lines and it takes many times to read all the file. I'd to know if there is a way to read such file more qu...
[no replies]
Linked List Issues:
 
#ifndef __addressList__ #define __addressList__ #include <iostream> #include <string> using namespace std; typedef struct node { string Name; string...
[9 replies] Last: Largin: Thank you very much. Some of your methods look cleaner then mi... (by jocdrew21)
by hassai
sort text file by first number of the line
 
hi can someone help me plz i have a text file like this 0 1 2 C 10 1 2 S 7 1 2 C 11 1 2 S 9 3 43 C 10 3 43 S 1 3 43 C 101 3 43 S with this co...
[3 replies] Last: #include <iostream> #include <string> #include <map> #include <fstrea... (by JLBorges)
by adn258
Why Do You Have To Use Different Pointers For Arrays?
 
So when if you want to change the values themselves for example in an array (just for example) this is valid; void test(int* test) { ...
[3 replies] Last: The ampersand & in your case is not the reference operator. int a;... (by Catfish666)
December 2013 Pages: 1... 56789... 37
  Archived months: [nov2013] [jan2014]

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