Beginners - April 2010 (Page 20)

if else statements and library functions used properly?
 
this is part of my program. can anyone tell me if it will work correctly. It is suppose to show a battle of a card game war and display the correct message, and...
[2 replies] Last: [quote=masterrick]but cant figure out why it is giving me 0 on the per... (by guestgulkan)
extern on headers makes difference ?
 
What is the difference if I put "extern" keyword prefix on these functions ? //ns.h #ifndef NS_H_INCLUDED #define NS_H_INCLUDED extern double max(doub...
[1 reply] : In this case - removing the extern keyword would have to effect b... (by guestgulkan)
question about delete keyword
 
so i understand that the delete keyword can only be used when something has been declared with the new keyword. so i have a couple of question/ 1) i heard th...
[4 replies] Last: ight thanks. (by jinjin12)
unknown error
 
i know im probably making a noob mistake here but i cant seem to get the following code to work string gotofunc (string x) { char found; string str1 = "g...
[7 replies] Last: string::size_type found = x.find(str1,0) is the corrected synatx and... (by mythbusterma)
by ToniAz
Class functions
 
Hello everyone, I'm new to classes... I created the class point that has abs and ord as members. I have a question: How can I create a function midpoin...
[no replies]
Can't assign element of string to char variable
 
So I'm inputting a string called canvasRow, which inputs fine because I'm able to display the string. However, I made a struct called square with an int row, i...
[no replies]
Problem with Template Classes
 
My code looks like this: template <typename T, typename R> class LinkedList{ private: class Node{ public: R data; Node* next; Node(const R& el)...
[3 replies] Last: As was pointed out: // note the "typename" template <typename T... (by jsmith)
by zinsky
Printing to a line using ofstream
 
Basically I am trying to use an employee ID to keep track of a clockin/clockout/overtimeEmployee IDs are 8 characters long. (ie 24001000). The following three l...
[1 reply] : yep... http://cplusplus.com/doc/tutorial/files/ (by Incubbus)
high scores...
 
Basically i've got a variable in a class called score which is keeping the score of my game. I am making a screen at the end of my game that displays the fin...
[1 reply] : Neither do I unless you provide a more complete program that demonstra... (by kempofighter)
by mmertt
Keyboard Input (arrows)
 
Hi. I'm trying to make a simple c++ console game. And i wrote a program to find the values corresponding to keys. #include <iostream> #include <conio.h> ...
[2 replies] Last: Links to get started with curses http://www.cplusplus.com/forum/win... (by Duthomhas)
Enumration vs Array Sorting
 
Which is more useful?
[1 reply] : To do what? (by Duthomhas)
cin.get() problem
 
#include <iostream> using namespace std; int main() { char a,b; cin.get(a); cout << a; cin.get(b); cout << b; return 0; } Why am I not pro...
[3 replies] Last: ??? What do you mean? The istream :: get () method is binary input... (by Duthomhas)
Having problem with exiting copied code
 
As I wrote the post below, it occurred to me that running a program from the command line is different from running it in an IDE. Is there a way to run a progra...
[8 replies] Last: To give precedence to * / over + - operations (by Bazzy)
by vulee
lost sign of an integer
 
Not sure why the sign was *silently* lost when running this code. Any suggestions to prevent this at run time? void print(int val){ cout<<"val: "<<val<...
[8 replies] Last: It's likely that an int without specifier is already long ... (by Bazzy)
traps for the dungeon...
 
Hello all, am working on the 'dungeon crawl' problem at present. Am happy with my game grid and at the moment I am trying to place a number of traps 'T' into th...
[2 replies] Last: Many thanks for the advice, exactly what i needed! The repeated cal... (by dan1973)
TEST SCORES
 
Hi please i need help with this question. I am supposed to write a program that dynamically allocates an array large enough to hols a user-defined number of ...
[8 replies] Last: well i wrote it myself.. was quite easy though; but tnx 4 tryin to ... (by shani09)
by Erco21
Random number game (extended)
 
Hi! I just wanted to post my project (which btw works just fine) to review it, and if someone knows how toshorten the code, or do something on more efficient...
[3 replies] Last: You asked for suggestions to improve the program. An improvement would... (by closed account jwC5fSEw)
by nammae
The different between type double and type float
 
I tried this following code: #include <stdio.h> int main() { float a, b, c; a = 0.1; b = 0.2; c = a+b; if (c == (a+...
[2 replies] Last: Thank you very much. (by nammae)
by Mreza
Conway
 
Hello! I need the code of conway's Algorithm. If you search the name("conway game of life") you can find what is conway Algorithm. But i as i am just a beginn...
[1 reply] : This forum isn't for demanding solutions to problems. This is a forum ... (by closed account jwC5fSEw)
by kodera
starting a "name sort" program
 
Writing a program for homework that involves sorting names in a 2D array using bubble sort.. I need help/direction getting the entry of names "entered" started...
[7 replies] Last: We are not allowed to use strings for this project (that was already t... (by kodera)
April 2010 Pages: 1... 1819202122... 35
  Archived months: [mar2010] [may2010]

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