[cpp] if(INPUT == 1) // Enter to the grade list, which than displays ID, name, than their grade in percent. Shows a wierd ass thing though
{
cout << "Welcome to the grade list, please wait while the ID file is loaded" << endl;
//Creating a table for the list which is pulled from the file.
cout << left << setw( 10 ) << "ID Number" << setw( 13 ) << "Last Name" << setw( 13 ) << "First Name" << setw( 13 ) << "Grade" << endl << fixed;
//Pull the data from the ID database and than list it
while( getline(DBFile, line))
{
cout << line << endl;
}
cin >> stuffName;
getline(cin, stuffName);
DBFile << stuffName << endl;
}
[/cpp]
The entire area where I attempt to write.
[IMG]http://i41.tinypic.com/1zzmet1.jpg[/IMG]
- Implemented a Locality Query database which almost doubled the speed =D
- Every unit now has to cast a ray to check the terrain's height which raped just like that all the speed I had gained =(
[QUOTE=darkrei9n;21825676][cpp] if(INPUT == 1) // Enter to the grade list, which than displays ID, name, than their grade in percent. Shows a wierd ass thing though
{
cout << "Welcome to the grade list, please wait while the ID file is loaded" << endl;
//Creating a table for the list which is pulled from the file.
cout << left << setw( 10 ) << "ID Number" << setw( 13 ) << "Last Name" << setw( 13 ) << "First Name" << setw( 13 ) << "Grade" << endl << fixed;
//Pull the data from the ID database and than list it
while( getline(DBFile, line))
{
cout << line << endl;
}
cin >> stuffName;
getline(cin, stuffName);
DBFile << stuffName << endl;
}
[/cpp]
The entire area where I attempt to write.[/QUOTE]
getline returns an istream so i have no idea what you're trying to do with that loop
[QUOTE=layla;21825809]getline returns an istream so i have no idea what you're trying to do with that loop
[editline]03:09AM[/editline]
while (!DBFile.eof())
{
}[/QUOTE]
My book says that the getline( cin, string) grabs the entire line from cin, not just the first word.
darkrei9n, I'm pretty sure you need an ostream (out stream) and open it with ios::out. Then use <<.
[editline]09:11PM[/editline]
[QUOTE=darkrei9n;21825870]My book says that the getline( cin, string) grabs the entire line from cin, not just the first word.[/QUOTE]
Why would an istream be just one word?
Yay for 3D labels :v:
[img]http://img402.imageshack.us/img402/8465/second3dlabels2.png[/img]
[img]http://img88.imageshack.us/img88/7200/second3dlabels.png[/img]
[QUOTE=Agent766;21825877]darkrei9n, I'm pretty sure you need an ostream (out stream) and open it with ios::out. Then use <<.
[editline]09:11PM[/editline]
Why would an istream be just one word?[/QUOTE]
I'm using fstream DBFile( "text.stu" ios::in | ios::app ) earlier in the program.
[QUOTE=r4nk_;21820910]Nice thread, I'm suprise how much cool shit I missed last thread![/QUOTE]
Agreed, I must have skipped over a bunch of stuff between seeing null's stuff. :P
[QUOTE=nullsquared;21825899]Yay for 3D labels :v:
[IMG]http://img402.imageshack.us/img402/8465/second3dlabels2.png[/IMG]
[IMG]http://img88.imageshack.us/img88/7200/second3dlabels.png[/IMG][/QUOTE]
Congratz, although the 6 and 8 are too close together on the second one.
[QUOTE=Chad Mobile;21826333]Congratz, although the 6 and 8 are too close together on the second one.[/QUOTE]
Yeah, closeness of the labels in 3D is a little annoying
[cpp]// Gradebook.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include <stdlib.h>
#include "windows.h"
int main()
{
using namespace std;
fstream ClientFile("grades.tst", ios::in | ios::out | ios::app );
fstream DBFile( "IDatabase.tst", ios::in | ios::out | ios::app );
//Error checking! Checks to see if the file exists, if it doesn't, creates a new one. Initially used ofstream but replaced with fstream so I don't waste space by adding a ifstream accompanied by a ofstream.
//This integer is for the error checking, in the earlier versions when the files we're replaced before they could be made the program would look for them, so a counter was introduced to make it wait.
if( !ClientFile )
{
cerr << "Failure to find grades.tst, creating file." << endl;
fstream ClientFile( "grades.tst", ios::in | ios::app | ios::binary );
::Sleep( 1000 );
cerr << "File Created!";
}
if( !DBFile )
{
cerr << "Failure to find IDatabase.tst, creating file." << endl;
fstream DBFile( "IDatabase.tst", ios::in | ios::app | ios::binary );
::Sleep( 1000 );
cerr << "File Created!";
}
void displaymessage();
int INPUT;
string line;
string id;
string firstname;
string lastname;
string stuffName;
cout << "Welcome to the Gradebook system designed by Kyle Devine, menu sortings are below." << endl << "1 - Grades" << endl << "2 - Instructions" << endl << "3 - Quit" << endl << "Just enter the number of the menu you want to enter" << endl;
cin >> INPUT;
if(INPUT == 1 || 2 || 3){
void displaymessage();}
if(INPUT == 1) // Enter to the grade list, which than displays ID, name, than their grade in percent. Shows a wierd ass thing though
{
cout << "Welcome to the grade list, please wait while the ID file is loaded" << endl;
//Creating a table for the list which is pulled from the file.
cout << left << setw( 10 ) << "ID Number" << setw( 13 ) << "Last Name" << setw( 13 ) << "First Name" << setw( 13 ) << "Grade" << endl << fixed;
//Pull the data from the ID database and than list it
while( getline(DBFile, line))
{
cout << line << endl;
}
cin >> stuffName;
while( cin >> stuffName)
{
if(DBFile.is_open())
{
getline( cin, stuffName );
DBFile >> stuffName;
}
}
}
}[/cpp]
This problem is really beginning to bug me, I have tried to get rid of getline() and it still does not write. I have used multiple ios:: things in the fstream. Nothing.
[QUOTE=nullsquared;21826617]Yeah, closeness of the labels in 3D is a little annoying[/QUOTE]
Is it possible to make each box slightly bigger so the numbers can be a tad further apart?
-nevermind was confused-
Oh yeah of course, you can change the grid spacing
[QUOTE=darkrei9n;21826836]This problem is really beginning to bug me, I have tried to get rid of getline() and it still does not write. I have used multiple ios:: things in the fstream. Nothing.[/QUOTE]
DBFile << stuffName; and ios::in | ios::out | ios::app.
I did hear though that you can only use ios::app with output only.
Fixed it! Removed the while statement around the cin << stuffName. However it does not grab the ID number.
Fixed the ID number issue but broke it again. I thought I would be smart, instead of messing with my write code a lot I would just add a counter and have its value set to the ID number. It works, there is now enough space for 100,000 IDs. But now the stupid name and grade won't write.
Still working on my iPhone app. Pretty useless right now.
HTML5/Download:
[media]http://img7.imageshack.us/img7/7118/009m.mp4[/media]
Imageshack video player:
[url]http://img7.imageshack.us/i/009m.mp4/[/url]
YouTube:
[media]http://www.youtube.com/watch?v=1Ek2juJJuzE[/media]
Anyone had any experience with Flixel?
Is it good to use?
[QUOTE=i300;21827779]Still working on my iPhone app. Pretty useless right now.
[url]http://98.149.169.171/imgupload/videos/009.MOV[/url]
(Sorry, I don't have a youtube and don't plan on getting one.)[/QUOTE]
My god, you expect me to wait for a 50 megabyte video to download at 105kb/s.
That is why you use YouTube.
[QUOTE=andersonmat;21828720]My god, you expect me to wait for a 50 megabyte video to download at 105kb/s.
That is why you use YouTube.[/QUOTE]
I know. Why don't I put it on imageshack.
HTML5/Download:
[media]http://img7.imageshack.us/img7/7118/009m.mp4[/media]
Imageshack video player:
[url]http://img7.imageshack.us/i/009m.mp4/[/url]
YouTube:
[media]http://www.youtube.com/watch?v=1Ek2juJJuzE[/media]
..what's wrong with Youtube?
[QUOTE=Chad Mobile;21828856]..what's wrong with Youtube?[/QUOTE]
I don't like youtube's community. An I am sort of too lazy to make an account. (I know it takes 2 seconds, blah blah blah)
Other than that, :iia:
Or you could just put it on YouTube like any normal person
Uploading to youtube now...
Anyhoo, this is not about youtube or not youtube. What do you guys think?
[b]Edit[/b]
[media]http://www.youtube.com/watch?v=1Ek2juJJuzE[/media]
i'm 2 cool for mainstream yo
finally fixed my camera drifting off when looking down and changing yaw.
[cpp]void Camera::MoveForward(float amount)
{
Vector3f upVector(0.0f, 1.0f, 0.0f);
Vector3f lookVector(0.0f, 0.0f, 1.0f);
Vector3f rightVector(1.0f, 0.0f, 0.0f);
Matrix3x3 pitchMatrix;
Matrix3x3::RotationAxis(pitchMatrix, rightVector, -m_rotation.x);
lookVector = lookVector * pitchMatrix;
Matrix3x3 yawMatrix;
Matrix3x3::RotationAxis(yawMatrix, upVector, -m_rotation.y);
lookVector = lookVector * yawMatrix;
m_position += lookVector * amount;
}[/cpp]
Made my first program after reading chapters 0&1 of Accelerated C++
[IMG]http://thecyl.com/vdt.png[/IMG]
(Code there just to prove anything unlike Chad)
The reason I had std::cin >> wait; is because I didn't know how to stop the cmd window from closing right alway after displaying result.
functions gogogo
[QUOTE=Cookies114;21829559]Made my first program after reading chapters 0&1 of Accelerated C++
[B](Code there just to prove anything unlike Chad)[/B]
The reason I had std::cin >> wait; is because I didn't know how to stop the cmd window from closing right alway after displaying result.[/QUOTE]
-sigh-
When will people give up?
just ignore them and eventually they will stop, don't bring more attention to it.
Sigh, it's Mother's Day (at least where I am), and if not, pretty damn close to it. And yet no programs for this great day. Unlike all you people, I put my 1.5 years of C++ skills to the test and made my mom a secret project. I'll let you guys have full source code so you can show your mom that way you can get off easy of not having a gift.
[cpp]
#include <iostream>
int main()
{
std::cout<<"Love you mom\n";
return 0;
}
[/cpp]
Sorry, you need to Log In to post a reply to this thread.