Beginners - May 2011 (Page 20)

Can I use ifstream and istream both?
 
I have a constructor Kruskal(const unsigned& , istream &is = cin ) to accept integer from standard input to construct the Kruskal object. Because ifstream is ...
[8 replies] Last: @Mohamed Fouad If you are going to use an fstream you have to previou... (by dangrr888)
something about system fucntion
 
i want to put all the contains returned by system("dir") into a text file. and also i wanna avoid the output on the screen (console program) when i use the sys...
[5 replies] Last: Here I go again with can't. You can't. system() spawns the shell, wh... (by kbw)
the using of scanf
 
my code is like this : char n; for(;scanf("%c\n",n);); my problem is : when I key in the first char ,It can not stored in char 'n',the second will. but ...
[8 replies] Last: The reason is that it is countermanded by the standard, but anyway, yo... (by Duthomhas)
by tagir
code only
 
aprogram that accepts mark of five student and thendisplay their average.the program shoud not accept mark which is less than 0 and mark greater than 100 . if t...
[1 reply] : I doubt anyone on here will be happy just giving you the answer. Consi... (by anonymous23323124)
Countdown Timer (1,2)
 
I wanted to make an countdown timer . What I wanted was that,say after, say, 20 seconds, do something (like in my case, change the value of an variable).I have ...
[20 replies] Last: First, what does using std::cout; and all mean? It basically means t... (by closed account zb0S216C)
by tagir
acode
 
a program that ca sum up anynumber of integers starting from 1 i.e sum=1+2+3+....+n
[1 reply] : another one. Edit: I suggest you post whatever code you have written ... (by writetonsharma)
Sorting a linked list
 
I'm trying to sort a singly linked list. I have a Sort function that is called by an Insert function after each insert. The problem I'm having is that when ...
[2 replies] Last: It would be easy if you make it recursive. Keep calling the function ... (by writetonsharma)
by Sabre
Object oriented programming (I think?) - Can this be tidied up?
 
I am working on a small console based ascii game in C++ Currently got the majority of the structure working but I am trying to improve it by using classes... B...
[2 replies] Last: I have not looked deeply inside the code but here are some suggestion... (by writetonsharma)
Urgent Help for homework - sum and difference Urgent Help for homework - sum and difference
 
I am not good at programming, my teacher gave me to write a program and i have to finish it in 2 days. Here is the program which i have to write Write a p...
[10 replies] Last: im out of time now, i have to pass that exam (by Fatal1ty89)
struct array
 
How can i access in a struct array the higher elements of the array. Here the code: #include <iostream> using namespace std; struct tree { int...
[2 replies] Last: Thx sorry i`ve simplified the code and accidentally made a mistake. Th... (by Asperadus)
by IvanLi
how can i use strtod to check number
 
hello, i got a task for check whether a char * is a number for example: char *strings = ".3.3.34"; which supposed it's not a number a number should ...
[1 reply] : strtod will not throw anything. I suppose you'll have to do it manuall... (by hamsterman)
by jls36
Console timer
 
I'm trying to implement a timer in the console to either display the time during the game or at least when I call for it. I'm a little confused on some of the t...
[1 reply] : ctime should be what you want http://cplusplus.com/reference/clibrary/... (by anonymous23323124)
Speed up loops
 
I have a program with a while loop that is running really slowly. I'm making a program that finds how many tries it takes to reach a certain password but it ta...
[7 replies] Last: The variables are actually characters in my passwords. I chose them s... (by GRex2595)
Attempting to change data in a file
 
I am trying to take data within a file and perform some operations on them So far I can read the file and also write to a different file, as in the results. ...
[10 replies] Last: Oh yes! Sweet Success Thank you sir I have it writing to a file Ca... (by greenace92)
Cin >> a >> '/' >> b;
 
Hello I'm quite new to C++ (Actually moved to C++ from C recently) So, I was trying to write a C++ program where I intended to read a rational number as p/q so...
[6 replies] Last: You can use your C method in C++ Just add "#include<cstio.h>" (I thin... (by NoteToSelf)
I need create my float. How?
 
Hi, I have an work that I need create my particular float. Because I need represent values how (-254 ...255).999, but without use float type. I think in use 19 ...
[4 replies] Last: Yes, is this! I saw that in C++ have type fixed in GCC. I'll study mor... (by thiagofmam)
by csmiss
Hashing function
 
---
[9 replies] Last: In this case, though, I'm betting it's just a simple case of csmiss ... (by Moschops)
Use variable between classes
 
Hi, I'm new to c++ and i was wondering if there is a way to use a variable from one class in another by sending it's value to the other class? for example vari...
[5 replies] Last: @piper355 When I try this it just gives me a bunch of errors in class... (by dangrr888)
Beyond my grasp !
 
I can't figure this out to save my life. There are a total of 744 records in the date file (i.e. a few lines shown below). When I run this (what seems like a...
[3 replies] Last: No problem. These are the types of problems that are hard to track ... (by Mathhead200)
[Linker error] undefined reference to `camera'
 
I've been stuck on this for ages, so I'd really appreciate any insight into the problem. I tried to add a camera class to the game I'm currently working on, ...
[3 replies] Last: np - as I have mentioned before, C++ shadowing is evil (by kfmfe04)
May 2011 Pages: 1... 1819202122... 48
  Archived months: [apr2011] [jun2011]

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