C++ :: Text For Score And Difficulty Doesn't Seem To Work

Sep 28, 2013

my text for the score and difficulty doesn't seem to work. They are both appearing twice and not updating. The score text worked fine until I inserted the difficulty text and I can't seem to find the problem. URL.....

#include "stdafx.h"
#include <iostream>
#include <sstream>
#include <SFML/Graphics.hpp>
int main()
{
sf::ContextSettings settings;
//settings.antialiasingLevel = 8;

[code]....

View 2 Replies


ADVERTISEMENT

C :: Calendar Doesn't Work

Sep 24, 2013

I just dont see what the issue is here. I have stared at this thing forever. Im trying to make a calendar from scratch so I can be prepared for my second test on Friday.

Code:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int i, n, s;

[Code]....

View 10 Replies View Related

C++ :: Do While Statement Doesn't Work

Nov 21, 2013

#include <iostream>
#include <string>
using namespace std ;
int main() {
string bored ;
do {
cout << " program" <<endl ;

[Code] .....

I made this as a simple do/while program, and if i run it, the second do/while statement will keep on going forever, without the [cin >> bored;] line working?

View 2 Replies View Related

C++ :: QuickSort Code Doesn't Work

Jun 9, 2014

I've implemented it a bit differently: I create 2 temporary arrays, one for the numbers lower from the pivot , an done for numbers greater then the pivot. in the end of each iteration the 2 arrays are copied to the original array:

Code: #include <iostream>
void QuickSort (int* A , int start, int end){
if (end-start<3){
return;
}
int mid=(start+end)/2;
int pivot=A[mid];
int lA[end-start] , rA[end-start], rCounter=0,lCounter=0;
int curr=0,i=start;

[code]....

View 3 Replies View Related

C++ :: Application Release Doesn't Work On Other PC

Dec 9, 2013

I am trying to release my C++ app to run on desktops that dont have VS installed and have created an install shield app to install on the desired computer. my issue is even after packaging it, it still requires certain DLL's...I read online that I had to copy 'msvcr120.dll' and a few others to syswow64 and sys32 folders but now when I try run my app it just crashes before starting.

I think it sucks that Microsoft no longer packages required DLL's like it used to in 2010.

View 1 Replies View Related

C/C++ :: Code For Bin File Doesn't Work

May 14, 2014

Ive been having a hard time creating bin file. Whenever I append data, the data wont show in browse function. And this program works good without the bin file code.

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

[Code]....

View 2 Replies View Related

C/C++ :: String Copy Into Struct Doesn't Work

Nov 1, 2012

i'm right now using C, IO is done via ncurses, but that won't affect the following problem, i think. The relevant code is:

#define SIDEBARWIDTH 27
//...
typedef struct {

[Code]...

surprisingly this works, now the new 3rd outputline is correct again. So it seems that the printcommand has some troubles with accessing the struct here. Not sure if that might be ncurses fault. Still feels odd.

View 2 Replies View Related

C++ :: Increase Char Code Doesn't Work

Jun 11, 2014

Code:

#include <iostream>
using namespace std;
int main () {
char character = 'a';

[Code] .....

the point of this code is to increase character by 1 (so from a to b in this case).

The line highligted in red is the line that the system is rejecting at the moment (but there may be other issues). why it is invalid?

View 5 Replies View Related

C :: Laser Project Tile Engine Doesn't Work

Aug 27, 2013

I should reduce the number of bitmaps I used in my code. I translated my particle engine into code that could be compiled as plain standard C

Currently, the code has a segmentation fault somewhere that I can't figure out. How it should function is that it takes orders from a queue for new lasers to store the instances in a linked list. It then takes that data and updates its coordinates, one node at a time. The first node should also be the first node to complete its life, so it gets removed, and the list is set to the next node in memory. If there are no more nodes left, a if-statement should catch it and either break the current loop, or wait for more items to be requested. If there are nodes left, the process will continue to remove the first node in the list until there are none left. Obviously this is not quite how it works. When I tested in once in SDL, the laser would update every 5 frames, but wasn't shown constantly, and would crash after the node was to be disposed of. When I initialize with the SDL parachute, it would exit before I event saw the screen. Also, the code I translated to standard C will display that the laser has been updated to the screen, but it never says that it has moved up. It crashes after about 4 printf() statments execute. My debugger has been giving me mixed SIGTRAPS, and "nothing is wrong" output. Here is the code in standard C:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_LASER_QUEUE 10
}

[code]....

View 6 Replies View Related

C++ :: Fstream Doesn't Work In Combination With Linked Lists

Jan 1, 2014

Im about to program a RPG and, of course, the player has got an inventory. The items in this inventory are stored in a linked list and have IDs in form of strings.

player.cpp: (just the most relevant)

#include <list>
#include <string>
using namespace std;

[Code] ....

Of course, when the player saves the game, the inventory has to be saved too.

game.cpp(just the m. R.)
#include <fstream>
using namespace std;
class CGame{

[Code] .....

Now, in my code I write the linked list into the file savegames.sav

void CGame::save(CPlayer* player){
m_out.open("savegames.sav", ios::out);
m_out.write((char* ) &player->m_inventory, sizeof(player->m_inventory));
m_out.close();
}

In another function i load the list:

void CGame::load(CPlayer* player){
m_in.open("savegames.sav", ios::in);
m_in.read((char* ) player->m_inventory, sizeof(player->m_inventory));
m_in.read();
}

And when i access the loaded linked list with the .empty() function or so, Windows says the following:

<Mygame.exe> funktioniert nicht mehr (in English: doesnt run anymore).

I tried so much to fix that but i dint reach my aim.

View 2 Replies View Related

C++ :: Matrix Class - Template Constructor Doesn't Work So Well

Feb 5, 2013

I realized a Matrix class to practice and I have a problem I can not solve! Here my problematic code:

Mtrx.h:

Code:
template <class T>
Mtrx::Mtrx(dim m, dim n, const bool random_constructed = false, const T min = static_cast<T>(0), const T max = static_cast<T> (10))
Mtrx.C

[Code] ...

And here the relative main section:

Code:
Mtrx rand1 ( 5, 5, bool);// ok
cout<<rand1<<endl;

Mtrx rand2 ( 7, 3, bool, -5, 20);// ok
cout<<rand2<<endl;

Mtrx rand3 ( 7, 7, bool, 0., 15.);// compilation error: undefined reference to
// "Mtrx::Mtrx<double>(unsigned long, unsigned, bool, double, double)"
// collect2: error: ld returned 1 exit status

I compiled in a Linux OS with g++ -std=c++11

View 3 Replies View Related

C++ :: Function To Count Digits Of Entered Number Doesn't Work

Feb 19, 2013

I wrote a program with function my own function which count the digits of entered number. The problem is whatever i type it shows 0 digits.Why is that?

Code:
#include <iostream>
using namespace std;
int cikCipari (int skaitlis, int cipars);
int main()

[Code] .....

View 7 Replies View Related

C++ :: Program That Asks User For Numbers And Adds Odd Ones Doesn't Work

Nov 12, 2014

Title is self-explanatory.

Code:
#include <iostream>
using namespace std;
int main ( ) {
float number;
float sum;
float divi;
while(number != -1) {

[Code] .....

View 5 Replies View Related

Visual C++ :: Fill Color In Shapes Using FLTK Doesn't Work For Circles

Aug 28, 2014

I installed FLTK 1.3.X from [URL] on my visual studio 2012 compiler and use PPP book for C++ programming [URL]. My problem is about filling a Shape in.

Code:
#include <Simple_window.h>
using namespace Graph_lib;
int main() {
Simple_window win(Point(100,100), 1000, 600, "Binary_tree");
Graph_lib::Circle c(Point(200,200),50);
c.set_color(Color::red);

[code]....

When I run the program, All three Shapes are drawn on window but only the Rectangle is filled in! Why? set_color works for the three and apparently the set_fill_color is defined for all Shapes and it too should work but why it doesn't for Circle and Ellipse?

This [URL] is the .CPP and .h files ( )

View 6 Replies View Related

C++ :: Difficulty Appending Local Buffer Value With String?

Apr 13, 2013

how to combine a string value with a local buffer containing time and date. I can't seem to get the syntax correct or find an example of this.

So I'll have a result like: The time is: 12:49 04/13/2013. My project will put different values in String mess1 depending on what's happening.

My code

char buf1[20];
String mess1 = "The time is:";
sprintf(buf1, "%02d:%02d %02d/%02d/%4d", hour(), minute(), month(), day(), year());
//mySerial.println(buf1); // operates perfect
mySerial.println(mess1 buf1); // Does not compile - error: expected `)' before 'buf1'

I have also tried a comma between (mess1, buf1), no dice.

View 3 Replies View Related

C/C++ :: Array To Only Print Out Final Average And Final Maximum Score With Final Minimum Score

Aug 27, 2014

#include <stdio.h>
float total, avg, max, min;
float judge[4];
int index;
int array[4];
int main() {
total = 0.0;
max = array[0];
min = array[0];

[Code] ....

I dont understand how to make the array when it prints out only print out the final average and the final maximum score with the final minimum score but what its doing at the moment is just giving an average for each individual score taken...

Minimum and maximum scores are displaying 0.0

And it displays these things 4 times in a row i just want it to be displayed once.

View 1 Replies View Related

C++ :: How To Store A Score

Mar 28, 2013

I want to do something like when you have completed the first question then the program will give you +3 in coins then you have completed next question then I want the program to add 3 more so it says you have a value of coins 6. But I do not know exactly how to do this the code I begun to write was this:

Code:
#include <iostream>
using namespace std;
int main()

[Code] ...

This code works for 1 question but I want it to work like add 3 for every question the user guesses correct. Like if user enters the correct answer 3 times then he/she has a value of coins 9.

View 2 Replies View Related

C/C++ :: Adding To Score Every Second

May 18, 2014

Currently in development of a cookie clicker clone (for fun)

I am stuck at the idea of the "Cookies Per Second" thing.

Is there a way to implement a per second adder thing that doesnt actually effect the game play (eg even though the player may not be pressing C every second a cookie (or more) will be added, or if they can press C more than once a second, every second a cookie will be added... If you get what I mean).

Code is below if you would like to look />

MAIN.cpp
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include "Shop.h"
#include "Varis mate.h"

[Code] .....

View 3 Replies View Related

C :: How To Get The Average Score For Each Student

Nov 10, 2013

I have to get the average score for each student. And modify my avgmarks function and write the marks to a output txt file.

Code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

int bubble(int*,int);
void filewrite();
void avgmarks();
void fileprint();
void filesort();
void rollin();

[Code] .....

View 1 Replies View Related

C++ :: BlackJack Game - How To Keep Score

Nov 20, 2014

A buddy and I have been working together to try and create a blackjack game for a project we are doing, and while we have a couple of issues we are trying to get worked out, for some reason we are perplexed as to how we can keep score. Right now, it keeps score but it doesn't reset when it adds a card. So if you had 14 and you hit, and added 3; you would have 31 instead of 17.

// initialize players and hands
srand(static_cast<unsigned int>(time(0)));
GetPlayerInfo(players);
do {
int score = 0;
bool busted = (score > 21);
ShuffledDeck(deck);

[Code] .....

View 2 Replies View Related

C# :: Nickname Won't Appear On High Score

Mar 28, 2015

I've made a game and a dialogbox to show up asking to enter a nickname.

The problem is After entering the nickname, it won't show on the highscore list below (textbox)

Where can the problem be? Below is my code:

private void btnPlay_Click(object sender, EventArgs e) {
if (txtName.Text != "") {
Settings.Name = txtName.Text.ToString();

[Code] .....

View 5 Replies View Related

C# :: Cricket Score Card?

Mar 24, 2010

I have to develop an application named smart client score board in c#

Main requirements for this application are that application should display the live scores, detailed score board, running commentary (in text), players and team profiles, statistics of matches, results and fixtures for cricket.

sort out websites which support rss feeds for full score card.

View 6 Replies View Related

C++ :: Giving Score To Correct Player

Jul 22, 2013

I have programmed a game where you guess a number (1-6) and if the number is equal to the random number then give the player score + 10. But if I have selected for example 4 players then if the game will give player 1 a score it gives player 2 a score instead? What can be causing this error?

Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int cube;
int number[4];

[Code] .....

View 6 Replies View Related

C++ :: Print Score In SDL With OpenGL Using Ostream?

Mar 5, 2013

I am using the following code to print in SDL screen

SDL_GL_RenderText( timer, font, color, &position);
sprintf(timer," Time : %d",time);

to print in SDL screen(used with opengl) , i am doing project on C++, as "sprintf" is C style function , so i can't do like this , i am trying to use" ostringstream" , but i am not sure how to use it.

View 1 Replies View Related

C++ :: Program To Keep Score Of Bowling Game

Dec 9, 2013

I'm writing a program to keep score of a game of bowling. Whenever I run the program, it comes up with the correct starting point, but whenever i type in the first number and click enter, the program stops running and it gives a return value of something similar to 3221225477. Here is my code. I think the problem might be that I'm not using pointers..? but I could be way off..I'm new to programming.

#include <stdio.h>
int main() {
int frame[10][3] = {{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0,0}};
int frameOutcome[10], frameTotal[10], currentFrame = 0, totalScore = 0;

[Code] ....

View 1 Replies View Related

C++ :: Reading TXT Files - 0 Unsatisfactory Score

Dec 10, 2013

int main() {
double x, avg, max=0.0, min=100.0,totalsat=0.0, totalunsat=0.0, totalout=0.0;
int invalid=0, outstanding=0, satisfactory=0, unsatisfactory=0, kount=0;

ifstream inFile;
inFile.open("grades.txt");

[Code] ....

When the program tries to open the text file it just scrolls "0 unsatisfactory score" forever. The text file has grades in it I'm trying to sort

63
75
121
72
72
78
67
-9
80 .....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved