What if I have a year like 1992 or 2006?
Type: Posts; User: wireless
What if I have a year like 1992 or 2006?
I have to write this function
int totDay(int m, int d, int y);
The function returns the total number of days for the given month, day and year from date zero. The teacher gave us a hint...
Compiling...
date1tst.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/ass3.exe : fatal error LNK1120: 1 unresolved externals
Error executing...
I having a problem with my output, it is correct, my problem is a formatting thing.
This is my output
: January 1, 1
d2(12,27,1992): December 27, 1992
d3(0,99,10000): January 1, 1...
I did it like this
void Date::setDate(int m, int d, int y, const char *name)
{
theMonth = (m >= 1 && m <= 12) ? m : MM;
theYear = (y >= 0 && y <= MAX_YY) ? y : YY;
theDay = (d >= 1 && d...
this is my function protoype
void setString(const char *str);
i have to call it from another function
its purpose is to to set a variale called *theName
this is how i did it, but I am...
Or does anybody know where i can find good notes/tutorials on class composition
i have two classes
//Event class
class Event
{
public:
Event();
Event(const Time & time, const char* name);
Event(const Event & event);
~Event();
I am a new to c++, I have to set the variable name to an empty string in the class constructor. This is the way i approached it, is this correct?
class test
{
private:
char* name;
...
its for an assignment..which the requires the function to be a const....using the variable name perimeter.
here's my function
double Circle::calcPerimeter() const
{
return perimeter = 2 * radius * 3.1425;
}
on visual c++ i get this error....
error C2166: l-value specifies const object
I've been trying the suggestions from people on this board and i'm still having troubles...
//Time.H
#ifndef __TIME_H__
#define __TIME_H__
class Time
{
private:
The assignment calls for ....
1. Default constructor.Set time components to 00:00:00. Use member intialization list to set values.
2. Constructor with 3 args, representing time components. If...
I am writing a time class. I have set the default constructor using member initialization list to set the values
// Time .h
Time(int hour = 0, int minute = 0, int second = 0);
// Time.cpp
...
I am working on a string class, which asks the user for a string. I have a fixed length array size of 100. I have to ensure that the string length is less 100, if its greater than 100 it only...
I have to ensure that a string entered by the user is all lowercase...
here is the code...
// String.cpp
#include <iostream>
#include <stdlib.h>
#include <ctype.h>
#include "string.h"
i am wrting a small function that takes a string in lowercase then i want to change it to uppercase. How do i do that?
I have to write a class called time, which has a set member function that takes no arguments which prompts the user to enter the time and assigns them to hour, minute and second. My question is if...
heres my code................
// time.h
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
I am wriing a school assignment
it asks the user to enter a char a short and an int...
if for example you enter 43 1234 45455
it accepts it as good input....how do i recject it if a user enters...