Beginners - March 2010 (Page 2)

by cppnew
How to handle carriage or newline character
 
When I try to read from a file, the last value is read twice if'Enter' is used at the end of file to create a new line. The code is as follows: #inclu...
[2 replies] Last: It works, great. Thanks (by cppnew)
Asking user input linux and gcc
 
Hi, I'm introducing myself in development in c/c++, I've got experience on basic and also I know the way the programs in c and c++ are structure, nevertherless ...
[2 replies] Last: What a fool, thanks bazzy, it appeared that build-essential was not ... (by diego1245)
Trouble with struct and bubble sort
 
I'm not really sure what I'm doing wrong, but I think it's a simple mistake. /***************************** * Made by Me * * Assignment ...
[5 replies] Last: Thanks again ^^; All I had to do is change it from if ( NA > NA[j... (by radikll)
Calculating avg scores
 
I am creating a program that will ask the user to enter 5 scores, then it will take these 5 scores and drop the highest and lowest scores. It will then average ...
[6 replies] Last: thanks... (by ksport99)
Reading words seperated by spaces
 
I am trying to read words separated by spaces from a file and store it in a c-string. The file i am reading from is set up like this: 1432532 Last, First 1...
[4 replies] Last: I still cannot figure this out.. any help would be appreciated. (by meeztered)
by CQ75
Complete beginner to win32 programming
 
#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline,...
[10 replies] Last: I see, that makes sense. Thanks! (by CQ75)
Making smaller version of chatterbot, Eliza
 
hello everyone, I am trying to make a smaller version of a program like Eliza, a chatterbot. Here is my code. #include <cstdlib> #include <iostream> #inc...
[1 reply] : never mind everybody. I got it working. Thanks anyways. (by hopephuly)
Upcasting through a pointer
 
I'm learning about polymorphism. Here's the code: #include <iostream> using namespace std; class Shape { public: virtual void draw() const { ...
[2 replies] Last: Ohhh, I see. I'm not entirely solid on some elements of function overl... (by closed account jwC5fSEw)
Encryption and Word Documents (0 bytes)
 
I am practicing writing a simple (not practical) encryption algorithm. I do not know how to write a 'good' algorithm, but I have one that seems to work on simpl...
[9 replies] Last: I will look into this bit shift method. Thanks. Is this how keys are t... (by closed account Lv0f92yv)
How to drop highest and lowest scores
 
I am trying to create a function that asks the user to input 5 scores, drops the highest and lowest score, and then averages the 3 remaining scores. I am not su...
[5 replies] Last: And why is sorting more logical than max/min? It causes modifications ... (by tummychow)
Using a string as arguement for a constructor
 
When I try the same but with int instead of string on all places (and 5 instead of "Hej") it works. //main.cpp #include <iostream> #include<string> #includ...
[5 replies] Last: may work but string data type has already a constructor which takes c... (by TunaPete)
by oman
complete this function
 
#include <iostream> #include <string> #include <fstream> using namespace std; void ReadData(int ,string ,string ,float ,int ); void DisplayMenu(); in...
[6 replies] Last: you might get a problem with your while look on line 35 as your i vari... (by chimera)
I would like you to play this C + + please
 
this is the text: write an algorithm that given as input two fractions, determine the sum, difference, product and quotient!!! thank you very much! I do that wi...
[1 reply] : We aren't here to do people's assignments for them. If you have speci... (by jRaskell)
Need Answer by TODAY. Worked for hours.
 
Write the appropriate loop that will ask the user to enter a positive number and add each number entered to a running total (accumulator). The loop should end w...
[4 replies] Last: I would not store all input integer to an array. Just keep track of to... (by maikel)
by suny
How to "save as" an existing text file
 
Can someone please help me on this? I need to make a copy of an existing .txt file and save it under a different name. The original file needs to be preserve...
[3 replies] Last: It's very helpful! Thank you both. (by suny)
Problems with delete[] inside of ~destructor
 
Hi, I am having problems while I am trying do delete an array from a struct. Actually, I am defining the struct with a destructor, in the following way: ...
[9 replies] Last: Many thanks Imi!! In truth I was fighting against the code for hour... (by margareto)
the program refuses to recoganize my function
 
hi. i use Visual C++ 2008. When i type in the code #include"stdafx.h" #include<iostream> using namespace std; char ttt = {'1','2','3','4','5','6','7...
[2 replies] Last: thanks firedraco,, these embarassing typos.... (by sanalsprasad)
a bug in my program
 
if i use execute program it output fine, but if i use command prompt it came out error and stop at "You have" double* getMile(int expectDrive, int year) { ...
[4 replies] Last: Thank You man i got it still need to work with pointer ;p (by shazlin)
Asking user input for file name to be used.
 
I was given an assignment to write a program that will read the contents from data files and calculate a paycheck after all the tax deductions. The only proble...
[3 replies] Last: See if it works before thanking me. =] But no prob. (by tummychow)
by joshky
Different String formats
 
Ok, so I've read up on ASCII and unicode and I'm pretty sure I understand. What I don't understand is how to get from one kind of string to another. For insta...
[4 replies] Last: I have Visual Studio 2008, but I don't have these files. Are they ava... (by joshky)
March 2010 Pages: 1234... 34
  Archived months: [feb2010] [apr2010]

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