OMG Thanks
I feel so dumb.
Type: Posts; User: jlharrison
OMG Thanks
I feel so dumb.
I am trying to figure out what I am doing wrong. I have included cmath.
I want to round the value of a double to the next whole number using the ciel function and store that value in a integer....
I see...
Thanks again for the help everyone! I was stuck for a while on that.
ifstream inFile;
string fileName;
cout << "Please enter the name of the file to open: ";
cin >> fileName;
cout << "You entered:" << fileName << endl;
maxhavoc, here are the declarations
ifstream inFile;
string fileName;
Thanks for the help guys I think a do while would work properly but I cant figure out why the only the priming...
I am trying to make a loop that repeats untill I get a valid file name from the user. Unfortunatly it only works if the correct file name is input on the first attempt. Can someone give me some ideas...
This is what I came up with for him after a PM.
/*
Create a voting booth program. Once both districts are completed, report to the administrator.
Your totals MUST include which candidate...
This post needs a <bump>
This is what I have.
#include <stdio.h> // includes standard in out library
#include <stdlib.h> // includes standard library
#include <time.h> // includes system time library
#include...
I declared my
CDInfo info;
in main.
I thought that structs did not need to be passed as pointers because they...were pointers. Maybe thats for an array of structs...
This does look like my...
I am getting a warning on the program I am coding and I dont know what the reason is.
// assigns a data type String
typedef char String[STRINGSIZE];
// Assigns a data structure for file...
You need a sentinal controlled loop.
I assume that '!' is the last person sentinal.
Pseudo Code
// cin first file strings
Adding the constant ARRAYSIZE to the typedef gets rid of the 3 error 2087s but I dont think this is the correct way to fix the problem.
typedef int SongArray[ARRAYSIZE];
If that is correct I...
#define works like this and comes after your #includes
#define USD 1.00; //1.00 USD = 1.00 United States Dollar
#define GBP 0.569280; //1.00 USD = 0.569280 United Kingdom Pounds
#define...
I am noob to working with typedef and and arrays. I need to pass them to a function that inputs the info in to the arrays from a file songData.txt. I am getting these errors but I am stuck. I am...
Maybe something like this? I havent ran this code but it should get you on the right track.
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR*...
Aha, I knew it was something dumb. Thanks Guys.
Just started working with functions and I cant figure out why this doesnt work. Can someone please explain? I know its probably something dumb, I just need some fresh eyes!
It only prints the...
Thanks again guys. I am learning this slowly but surley!
I think you are refering to OPTION 4 Custom Validation.
That seems way ahead of where I am in class right now. We havent covered arrays or some of the other stuff in there yet.
First create a new solution in MSVS. Then go to new> files> c++source file. You will have to name the file before it opens. Name it Foo.c or whatever.c if you do not want it to be a .cpp file.
I...
I need to make sure the user enters a number from the menu. The do while loop will ensure that I get the choice in the right range. I now just need to be sure that the number entered is not a...
You absolutly right. I am a noob and should have kept my mouth shut!
#include <stdio.h>
#include <string.h>
int main()
{
char name[10];
printf("Please enter your name.\n");
scanf("%s", name);
printf("Hello %s!\n", name);
I am really new to C and my instructor does not do a great job explaining things. Wondering if one of you can clarify this for me.
I need to keep asking for input untill I get a R or S.
...