Beginners - January 2014 (Page 2)

start time,end time and execution time for c++..
 
Start time, end time and execution time for using text file in c++.. output: Hours : Minutes : Seconds Start Time : 12 : 05 : 32 ...
[1 reply] : Giving code is not helping. What have you done so far and what do you ... (by giblit)
Program won't build at home but at school it works.
 
The school has visual studios 2010 and i have the 2010 express version at home. My programs run fine at school but at home they won't run. Here's an example of ...
[4 replies] Last: https://stackoverflow.com/questions/10888391/error-link-fatal-error-ln... (by Zhuge)
by sky3
reading in integers from a file
 
for the life of me i cannot figure out why this wont just read in and output correctly. when i cout it, it wont get the third number and i end up with: 2800000 ...
[4 replies] Last: yea i just realized that lol. it was using the scientific notion for ... (by sky3)
by eonly
Function
 
How would I write a function that takes an array of char that holds a c string, and a char variable, and return an integer representing the number of times the ...
[1 reply] : Start with the prototype. Show what steps you know you should take, ex... (by Zhuge)
simplifying code and looping
 
Is there a better way to do this than adding output = GRADE + gradeOut; between each if statement? Also how can I loop it back to the beginning if the score i...
[6 replies] Last: Great, thanks again! I added a do/while loop that says: do { //stuf... (by horkavi)
Project Euler question 2
 
The program I'm trying to write is supposed to calculate the sum of the even Fibonacci numbers less than 4 million. My code generates the correct values of the ...
[3 replies] Last: Ah I see I was thinking he had lines 18-22 and line 16 switched. I lik... (by giblit)
Project Euler Wrong answer
 
This code gives me the wrong answer after researching online for the answer. Can someone tell me why? Problem 1: If we list all the natural numbers below ...
[13 replies] Last: natural numbers You're correct Chervil. Counting from 0 has become ... (by closed account j3Rz8vqX)
User Input Help!
 
Below I have my code, where it checks if a number is prime, and then it overloads the -- and ++ operators to find the previous prime number and the post prime n...
[2 replies] Last: thank you!! (by giraffe1234)
Should I be using threads?
 
Hello everybody, This will be somewhat of a simple question, I am trying to write my first useful win32 program which involves opening a serial port using "c...
[1 reply] : Yes, I'd probably say use threads for this. C++11 has support for thr... (by Avilius)
Function Returns Empty String Every TIme
 
Excuse me, Im trying to create a command line application in which I have a function that is supposed to give me what # argument was typed in. For example, cons...
[2 replies] Last: I think that Duoas has a much better answer, but I hope that this can ... (by MaxterTheTurtle)
user input help :L
 
Just started learning c++ and ive got a bit stuck :L I'm making a console application that injects a file into a process. The file name and process name are b...
[5 replies] Last: Read a tutorial on std::string , as it seems someone accidentally tau... (by LB)
Naming Conventions
 
Hello, This is a pretty easy question. It relates more to source/header naming conventions than variable and function naming. I was getting back into C++ and...
[1 reply] : It doesn't really matter, so long as your toolchain can tell them apar... (by Duthomhas)
IntelliSense errors?
 
I am working on a project that calculates the fare for a ferry. I have started, not even close to finishing, when I started encountering this error... This i...
[10 replies] Last: So, these need to be inside/outside of curly brackets?? (by Katie Gerloff)
constructers and classes
 
How come when I try and display user.strength in the main() function, 0 is displayed? help! #include <iostream> #include <string> class player ...
[2 replies] Last: thanks so much, i've had this exact issue before, i don't know why i d... (by ASCII14)
Regulating FPS in sdl
 
Why doesnt it work when it's less than .25 frames? #include "SDL.h" #include <iostream> #include "SDL_ttf.h" #include "SDL_mixer.h" #include"SDL_ima...
[2 replies] Last: Yes that was careless of me lol , it was easy to solve but i didn't kn... (by Sharan123)
by lekha
help in pointer
 
int x = 3; cout << x<<2*x; output of the code is 36. can anyone please explain me why is it 36.
[1 reply] : You are not using a pointer. You are using an integer variable whose v... (by Danny Toledo)
simple if/else statement (produces wrong value)
 
How do I get this if/else statement to work properly? when you enter a name between 'p' and 's' it should send you to room 2432 but no matter what value you ...
[1 reply] : Look at line 11, you are reading a space into the string before readin... (by Smac89)
Reading in binary data and displaying as hex.
 
Trying to figure out how to read in data from a binary file one byte at a time, then display it in hex. From my googling, I've figured out this much, but when I...
[7 replies] Last: Yes that's probably it. What I was saying was ifstream fin( "test.da... (by maeriden)
SDL_BlitSurface();
 
In SDL_BlitSurface(): what is the use of the second argument for example SDL_BlitSurface(image,NULL,screen,&position); SDL_BlitSurface(image,&position,s...
[2 replies] Last: Yes i have started using sdl 1.2.5 recently because there aren't tutor... (by Sharan123)
separate words with hyphen
 
Hi so I am trying to make a function that gets a string and returns two or more different words if they are separated by hyphens. for example input = some-thin...
[4 replies] Last: What do you mean? Each word would be an element in the vector, with no... (by LB)
January 2014 Pages: 1234... 44
  Archived months: [dec2013] [feb2014]

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