Beginners - May 2010 (Page 29)

creating streams
 
I want to create a stream for input and output, but without using an fstream or iostream, just something I can use the .peek() and .get() functions with. Is ...
[4 replies] Last: That's what istream and ostream are, streams who's details are obscure... (by kbw)
by hybzik
trying out fork() and wait(), compiler seems to forget what dereferencing is
 
#include <stdlib.h> //recommended headers for wait(), if CC says wait not defined, try these: // #include <sys/types.h> // #include <sys/stat.h> #include<...
[1 reply] : wait is undeclared (which is not at all what the compiler is saying, b... (by jsmith)
tic tac toe
 
I have write this code to play tic tac toe but it does not like to work right. I need to check to see if there is a winner andto stop cheat and to run a loop bu...
[1 reply] : if (v=1) Assigns 1 to the variable v, then tests whether or n... (by jsmith)
by A Atta
Static data member doesn't maintain its value
 
Hi all, i made static ifstream object but it causes an access violation error, i declared it like this: // in .h file private: static ifstream reader;...
[1 reply] : Have a look through the VS2008 release notes. My guess is that this w... (by PanGalactic)
by cortez
Stuck on a function.
 
Im working on a assignment and im having problems setting up the last function for this assignment which is the cost....This is what i have so far and this is t...
[3 replies] Last: I imagine the problem means that for every thousand gallons above 3000... (by dan1973)
What's wrong with this..... Pointer Variables//Addresses
 
#include <iostream> using namespace std; void dnl(); int digit = 25; // Variables float number = 12.5; char letter = 'A'; int s...
[6 replies] Last: Darn I am having more trouble now, I need to find information on "set... (by m4ster r0shi)
by ollie
Linked list error
 
I am using a linked list for the first time and am trying to add an entry to the list. However I am getting an error in this section of code: if (is_tri == ...
[2 replies] Last: I found that I actually did not use inheritance correctly so have it s... (by ollie)
Pointers...wait..WHAT?
 
Hi, I read a couple of books and they do not explain quite well about what is the purpose of pointers. Why we use them in a function instead of regular var...
[2 replies] Last: Pointer are - as the name suggests - pointing to some other informati... (by imi)
by clio78
storing values. ARRAYS ETC
 
i am writing a program whereby i have written the instructions the shell of the program, and have written code for inputting values, but how do i collect all th...
[3 replies] Last: Ok, I got it. If you know the number of iterations (i.e. how many time... (by m4ster r0shi)
Finding a palindrome number
 
i was trying to find a program which checks whether a number is palindrome but while testing one of the functions doesnt seem to work. Please help. Thanks in ad...
[5 replies] Last: i found a code for converting int to string. and now my functon works ... (by sanalsprasad)
deleting pointers
 
Hi, if I have code like this: void main() { int *pPointer = new int; *pPointer = 25; printf("Value of *pPointer: %d\n", *pPointer); dele...
[7 replies] Last: Hi, I've been reading through those two links and I can't really see a... (by ElMatador)
True/ false test program
 
I am need a boost in writing a program that processes test data. I don't know how to start it. This is what the the question says: "The teacher needs hel...
[3 replies] Last: They aren't hard-coded. The first line of the input file has the corr... (by Duthomhas)
by TonyT
Cannot get the ouput code?
 
// Copyright (C) Tony 2010 <tonytran@charter.net> #include <iostream> int main() { // what is the output of the c++ code? int x; int y; int *p ...
[6 replies] Last: Ooops sorry about that, I didn't saw that's already been declared. (3:... (by blackcoder41)
Quick question about seeding rand
 
I've heard you're only supposed to seed random once; but is that once per function, or once in the code? Thanks in advance all.
[3 replies] Last: Seed once and only once. Seeding more often than that reduces randomn... (by jsmith)
How would I error check this
 
I am having trouble trying to figure out how to error proof this code. int addDays=0; int index =0; int position =-1; bool found =false; string valu...
[no replies]
Form
 
Hi, I have a program written for the console to generate a script for my school's announcements in the morning. I need to know how to turn it into a windowe...
[6 replies] Last: Google it. (by Duthomhas)
by Phasa
Assertion Failure Using Vector
 
It compiles and runs, but after "Here is the starting empty cubes vector" prints, I get this message: Debug Assertion Failed! Expression: vector subscrip...
[10 replies] Last: I think you're right. I tried it in Codeblocks and removed "stdafx.h",... (by Phasa)
Problems with a do while loop
 
I have a do while loop that has if statements in it. The problem is that once it is done executing one part of the if statement, it automatically moves to the n...
[5 replies] Last: I solved it for some reason it didn't like my else statement. It wante... (by lovely6922)
a-z, 1-9 in c++?
 
ok so i forgot, but in php or perl, or maybe both, i could compare lets say a string with the letters a to z or A to Z by doing a-z, A-Z respectively instead of...
[14 replies] Last: http://cplusplus.com/reference/ EDIT: Yep, I used the reference. Aw... (by Albatross)
by ashd
How to use class function in another class?
 
Hi, I'm new to C++ programming and trying to make a program. I have a class called connection which has member objects of another classes. eg: Class...
[1 reply] : Tsk tsk tsk. Class needs to be not capitalized. :) And you need a... (by Albatross)
May 2010 Pages: 1... 2728293031... 33
  Archived months: [apr2010] [jun2010]

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