That helps... But how do I get it to wait...
main (int argc, char *argv[]) {
printf("Enter Selection Please: "); <-- WAIT HERE FOR INPUT...
char x = getchar();
if(x = "m") {
do stuff;;
Type: Posts; User: guda
That helps... But how do I get it to wait...
main (int argc, char *argv[]) {
printf("Enter Selection Please: "); <-- WAIT HERE FOR INPUT...
char x = getchar();
if(x = "m") {
do stuff;;
how do I wait for input for a text character or string?
ie:
main (int argc, char *argv[]) {
while ( argv[0] != NULL) {
printf("Enter Selection Please: "); // I want it to wait here for...
got it... thanks guys.
OK, this isnt a project, just a sample test that we are suppose to work through, however the "real test" will closely resemble it.. ie, reading in, processing double matrix..
The first Number...
doesnt cin.get() only work with char data types?
I am working with integers... reading integers...
Im usng cin, and trying to recogninze a newline character like this:
while( !cin.eof() ) {
cin >> row >> col;
if(col=='\n') {
occupied = row;
display_array(m1);
...
const int SIZE did it..
thank you gentlemen :-P.
Basically this program just reads in a seating chart... Problem is I keep getting the error below... Im not sure what it means... My code seems correct?.. any help?
getting error
...
haha... your a lifesaver... or in my case I should say you just saved me from becoming bald 10 yrs early :-).
IM getting an error, and have no idea what the cause is.. Im creating a virtual class function and its driving me nuts..
I get the following:
square.cxx:6: error: virtual outside class...
I am trying to sort an array of strings... eg..
george
sam
ralph
lisa
arnold
Im trying to sort this array like:
Yes, that does work... I tried that before, however it kept segfaulting.. I see now that the segfault occurs in display() and not in main();
Here is display, in case anyone sees an error, tiing...
HI, little help requested.
i am trying to select the members of a class object b1[i], by comparing
a member->value with and external value, and if the comparision is
true, then I would assign...
this fixed it :-).
thanks.
void book::setValues(string title, string author, string publisher,
string month, string year, float...
doesnt/isnt:
b1[size] = new book(title, author, publisher, month, year, price);
suppose to assign the data in the parameters, to the values in the class?
this is it for constructor:
book.cxx
#include "book.h"
#include <iostream>
#include <string>
using namespace std;
.h file
#include <string>
#include <fstream>
using namespace std;
class book {
hi.. Im trying to assign varibles to a class[array] using the new operator in a for() loop however I am having problems.. When i cout the data, it is all blank, so the variables are never actually...
Unfortunately I cant declare it as protected (project guidelines) so declaring the calss as a friend will work, and does work for that matter, now I just have to get it to print out the correct data...
ok, well I have decided to do this in my insurance.h file:
class insurance: public date {
private:
date birthDate;
public:
int getDay() {return birthDate.day;}
Hi.. I am having a slight problem with one of my projects and was wondering if anyone could help. I do not understand why this is not working like it should.
Here is my class(this is a base class...
I get various errors... , and yes I am successfully opening the file..
it starts out with something like this:
g++ -g -Wall -c car.cxx
car.cxx: In function `std::istream...
HI,
Im trying to get this to work, however i cannot and it is driving me crazy, what I have is a text file from which i am trying to read in the data into members of a base class, and two derived...
thanx for the help !!.
ah ha..
actually the syntactial errors were from just typing in default values and not the *actual code...
In my real program. letter is declared as char...
sorry about that..
But the...