Beginners - February 2010 (Page 15)

by cmccmc
Invalid Calculations
 
Im getting invalid answers to the problems. For example if I set B=-3 , A=1 , and C=-4 I get -17 when I should be getting 25. Anyone mind telling me why? ...
[5 replies] Last: yeah i looked at your method but Disch's was simpler but yours would h... (by cmccmc)
Reading File
 
I want to read a txt file line by line that looks like this. header { version { "0.95" } build { "2007.04.02" } } environment { grid { 1 10 50 50...
[2 replies] Last: Thanks! (by EvanEjk)
by dat722
months in numbers to letters
 
How do i make the range of months from 1-12? How do i make the days of the months so it can be valid. For example 2 29 2003 is invalid because 2003 is not a lea...
[3 replies] Last: if (valid_month && valid_day && valid_year) { if (leapY... (by dat722)
double to txt file
 
Hi, I want to save the value of a variable in a txt file, but when open the file to see the result it is empty I have the following code: #if defined(W...
[2 replies] Last: Sorry.. it is actually declared... I missed it when I wrothe the code ... (by studentffm)
Counting instances of a words
 
I'm in the early stages of C++. Right now, I'm trying to write a program that will read a file and print the number of times a word appears in the file. The pro...
[2 replies] Last: Worked great, thanks for the help! (by closed account jwC5fSEw)
by indigo
L"string"
 
Hi, There is a L"mystring". What to do if i have: string s = "mystring"; Messagebox(NULL, ??? s, ...); How to do the same thing as L"Mystring" with variab...
[3 replies] Last: Thanks for answers, it helped a bit. I got the conversion by writing: ... (by indigo)
ususual colon use - meaning?
 
Here is a segment of code used to store information related to the BLAST sites on a device communicating with the CPU over a PCI bus. (BLAST stands for Board L...
[1 reply] : bitfields. It specifies the width of the variable in bits. IE: BL... (by Disch)
Class function problems
 
Hi, I'm having a problem that seems to have no base. Inside my class 'binary', I have a function: int getNumber(); This function gets the integer for...
[no replies]
by adtr
reading file
 
I have this assignment. I have to read how many lines, tags, comments, links, chars, chars in tags and percentage of characters in tags in any given file. Here'...
[1 reply] : Go line by line. Set a counter to track how many lines you read in. In... (by tummychow)
by ALB
anyone know what wrong with my program?
 
my problem is when u run the program it give u the same thing
[4 replies] Last: we may not know what wrong with your program until you post your code (by Maimaje Bello Abdullahi)
time and time formatting problem
 
Two problems: 1.) The date that I am getting is: Sun Dec 1 08:51:44 1935 2.) After the date it is inserting a new line that I do not want. Thanks in adv...
[6 replies] Last: I never realized that asctime() adds a newline, but sure enough: http:... (by PanGalactic)
by ALB
question on programming
 
how a average parameter suppose to look like?
[8 replies] Last: got it thanx (by abhi201090)
by wasabi
Maximum off_t value?
 
I am currently outlining a program I'd like to make, but before I can even really start to think about it, I need to know if there is a maximum filesize that ca...
[11 replies] Last: it finally worked, thanks! I was using "#define _FILE_OFFSET_BITS 6... (by edu083)
spent hours and still do not know why!? sEGMENTATION FAULT
 
hey guys im write a program it has a class called BigInt which is on a separate header file. this program is far from finished but before i decided to go on wit...
[4 replies] Last: ok i think i found out why, but im not 100% sure, i have to test it fu... (by jinjin12)
C++ TEST!
 
Guys I have a test right now and I haven't studied. Please help me out? heres the question: write a program that reads information for 3 students. The inf...
[17 replies] Last: lol good point (by cmccmc)
by cmccmc
Incorrect average
 
Why doesn't this code calculate the correct average? For example when the average should be 3 it displays 7 #include <iostream> using namespace std; int m...
[3 replies] Last: okay I forgot about the order of operations edit: worked perfectly Th... (by cmccmc)
classes over multiple files
 
I have 3 header files in my project and 3 .cpp files: main.cpp, game.cpp, player.cpp defines.h, game.h, and player.h ========================================...
[6 replies] Last: It actually probably looks better now. Globals are what are "ugly".... (by Disch)
Signed and unsigned numbers
 
How can the computer tell the difference between the signed and unsigned numbers... since they all look the same. For example: * if it is a unsigned number 100...
[3 replies] Last: C++ is statically typed. That is, everything has a known type at compi... (by Duthomhas)
code doesn't work as expected
 
Why? I wanted the function checkWin() to return true if the player guessed the number... The player should guess the number using LEFT arrow and RIGHT arrow... ...
[1 reply] : omg... this is sooo embarasing :| if(IsKeyPressed(VK_LEFT... (by adikid89)
by Nikoru
Question about my script
 
#include <iostream> using namespace std; int main() { cout <<"Compiles Properly/n"; //Variable Declaration int Spellcaster; ...
[2 replies] Last: @1. here some code example: #include <iostream> #define SPELLCAST... (by adikid89)
February 2010 Pages: 1... 1314151617... 32
  Archived months: [jan2010] [mar2010]

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