General C++ Programming - February 2013 (Page 33)

by DrZoo
Pointers Help
 
I'm working on an exercise for pointers. I'm supposed to calculate the primes from <= x. Inside of my FOR loop I get the "expression must have integral or enum ...
[4 replies] Last: What every one else said, plus this: And one should never use doubles... (by TheIdeasMan)
c++ problem
 
int num; cout << "Enter a number: "; cin >> num; If user inserts a char, i want the program to print: "Please enter a number." How can i d...
[2 replies] Last: You can also do it without the string or stringstream libraries. #inc... (by MrHutch)
Unusal use of using keyword
 
Hi All, I am trying to get involved in the open source community and have offered to participate in a project, downloaded it and tried to go over the code an...
[2 replies] Last: Thanks JLBorges, Gave me the necessary information I needed to discov... (by devLinuxApp32)
reading till end of file problems
 
I have been working on this program for a couple of days now and I still cant seem to get it to do what I want it to do. I am using fin.peek() to read characte...
[1 reply] : I don't really understand your code but if your file has pattern like... (by rmxhaha)
Five Dice Roll: Vectors
 
My issue is that my program dies whenever it attempts to readout the average and sum of the rolls. I think I need to include the size function in here somewhere...
[3 replies] Last: I promise I'm not that stupid, but I guess I am... Luckily enough par... (by HerpDeDerp)
by xismn
Strange Linking error
 
Hello, and thanks for looking at my question! Let's cut to the chase : I've got an LNK2019: unresolved external symbol error in my most recent project. I've ne...
[4 replies] Last: Solved. Turns out I was an idiot. A #define sneaked it's way into one ... (by xismn)
by cob
void value not ignored as it ought to be
 
Hey guys! Just relearning c++ and i'm running into this error. I remember addressing it in high school but, that was years ago. Thank you in advanced! The ...
[2 replies] Last: Thank you so much! I knew it was something simple like that. srand ... (by cob)
Help with pulling integer sizes within a function
 
Hi, I'm struggling with this lab assignment and I hope someone could give me some tips. I'm trying to find the MAX and MIN integer sizes that are entered in ...
[4 replies] Last: Would it be possible to provide an example on how I could go about doi... (by ovaltine99)
printing permutations of digits of a number
 
I have been trying to write a recursive function to print the permutations of a n-digit number. This is the logic that i am trying to use. 1.call the permuta...
[3 replies] Last: // permutation2.cpp : main project file. #include "stdafx.h" #incl... (by Adikish)
reading in a file and storing it in a string.
 
So, before I go any further, let me explain... I know how to do this in c++ with fstream and std::string and getline and so on and so forth. Im writing my code ...
[16 replies] Last: Same as in C++: perform the input, then test if it failed: int c; // ... (by Cubbi)
A nice method to display permutations of digits/characters
 
#include "stdafx.h" #include<iostream> #include<stdlib.h> using namespace System; using namespace std; int fact(int n) { if(n<=1) return(1); el...
[no replies]
error in search...simple dictionary codes..
 
guyss need help for search....there is no content when i search word in the dictionary.txt....this is my example of dictionary.txt...in the add case it is worki...
[1 reply] : ifstream write("dictionary.txt", ios::in); ofstream read("dictionary.... (by shacktar)
using a # from a string
 
I have a string based program, and you need to use the first input as the operation (i.e add, subtract) and the number after the command (for example add3, but ...
[3 replies] Last: can you list a few examples illustrating various components of the inp... (by SIK)
C++: Can I print different colors simultaneously?
 
For school, I decided to simulate Conway's Game of Life. Things went very smoothly until I decided that the game needed to be in color. Using information found...
[10 replies] Last: correct me if im wrong, but isn't that all win32 code? so it can't be ... (by closed account Dy7SLyTq)
by koga
why do we use these ->
 
Im working with some frame work for a university project and : player1->passCardToPile(*pile, 1, true); //this works it passes a card from player1's hand to...
[5 replies] Last: a->b; (*a).b; They are same. The first one makes perfect sense in ter... (by CroCo)
by ET21
Setting up an Invalid Response
 
Basically the whole purpose of this program is to prompt the user to use a calculator. Choices 1-6 are valid, but I want to set it up where selecting any other ...
[10 replies] Last: [quote=ET21]Just a simple operation takes a lot of coding. This isn't ... (by LB)
alter the user input
 
I have this code here that counts the number of alphabetic letters the user's input,the number of characters total, the number of words and the number of "the" ...
[7 replies] Last: Oh I could try do that.......might take me some time though....I'll tr... (by greenleaf800073)
by LFDC
Error overloading operator + class template vector
 
Hi all! I'm trying to implement a vector class in C + +. However when I go to actually run the main, it generates an interrupt operating system. Do you see a mi...
[7 replies] Last: According to this thread, the new T should work but it can still thro... (by kempofighter)
by ET21
Area of a Triangle
 
Edit: I figured out how to do everything and it works, but my area for the triangle part keeps giving me values of 0 for every answer. The program is a Geomet...
[4 replies] Last: Sorry for the late response, but I was able to get it bout 5 minutes a... (by ET21)
Pointers to structure
 
Hi friends here is my code please have a look at end i'll tell you what is wrong #include <iostream> #include <conio.h> using namespace std; struct emplo...
[2 replies] Last: It can also be done without using pointer arithmetic: employee user ... (by toum)
February 2013 Pages: 1... 3132333435... 43
  Archived months: [jan2013] [mar2013]

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