C++ :: Showing Data Added To Classes
Feb 15, 2014
I am new to using classes, and am running into an issue already. I have created the class, and am in the process of adding data to the classes. I have added one piece of data, and now just want to see if I can get it to show in another function, but I am not sure why it is not showing. What about getting the data to show. Then, I will be able to work on adding the rest of the info.
#include <iostream>
#include <cctype>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
//******************************Bill Class**************************
class bill {
[Code] ....
FYI - This is only the relevant code. There is more for this that I have not added.
Error #1: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
Error #2: error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
View 2 Replies
ADVERTISEMENT
Nov 10, 2014
The problem is that the data table doesn't show at all. Here is the code:
<%@ Page Title="" Language="C#" MasterPageFile="~/LB/MasterPage.master" AutoEventWireup="true" CodeFile="InsertedInfo.aspx.cs" Inherits="LB_InsertedInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
[Code]....
View 5 Replies
View Related
Jun 1, 2013
I have an application with general customer detail.
It has TextBox and radio button.
First I have used if statement then code but on first step is working fine then error is showing.
try
{
if (textBox1.Text == "")
{
[Code].....
View 5 Replies
View Related
Dec 29, 2013
I have a situation: I have a class character
class Character;
class Village;
class Character {
public:
//Functions
void charGen(); //Character creation
[Code] .....
According to the Friendship and Inheritance tutorial [URL] ...., that code should work, but it doesn't. I am given an error: undefined reference to questsCompleted
The compiler I am using is Code::Blocks ....
View 4 Replies
View Related
Jun 9, 2014
Why certain projects always roll their own data structures/utililiy classes rather than using the C++ standard libraries? such as linked lists and queues? Is there a particular reason for this?
View 11 Replies
View Related
Apr 12, 2013
A company uses two text files: one to store employees' details and another to log their sign in/out time.
The details file - called details.txt" has the following format: ID, Name, Date of Birth, SSN, Department, Position - separated by spaces.
An extract from the file looks like this:
10 alice 4/23/1972 123-45-6789 support assistant
3 bob 6/7/1980 111-12-1134 logistics manager
1 carol 10/2/1963 987-123-1143 admin ceo
2 dave 10/3/1974 902-22-8914 admin cfo
17 erin 6/13/1991 126-83-1942 technology supervisor
15 frank 2/22/1987 303-12-1122 logistics assistant
"timelog.txt" contains daily logs of when employees arrive and leave. It has the following format: ID, Date, Arrival Time, Departure Time - separated by spaces. An extract from the file looks like this:
10 2/11 0900 1700
3 2/11 0930 1730
1 2/11 1100 2000
2 2/11 1000 1530
17 2/11 0900 1700
10 2/12 1000 1830
3 2/12 0930 1730
1 2/12 1100 1900
2 2/12 1030 2000
17 2/12 0900 1700
15 2/12 1100 1600
I have to write a program that searches for specific records using some search parameter, and displays them. Ok first i have to read the data from the files and store them. this is what i have so far....
#include <iostream> //Accesses libaries for console input and output
#include <fstream> //Needed to access the fstream object to read files
#include <string> //Needed to access the string class
#include <cstdlib>
[Code] ....
I know my class and array code is totally wrong i dont know how to store the data for the info is in integer and string form... do i use strings, arrays?
View 1 Replies
View Related
Oct 5, 2013
I have an array of (Student)classes created in Manager.h, which contains a new instance of class Name (name),(in Student.h)How would I go about accessing the SetFirstName method in Name.cpp if I was in a class Manager.cpp? I have tried using Students[i].name.SetFirstName("name");
// In Manager.h
#include"Student.h"
class Manager
{
[Code]....
View 2 Replies
View Related
Aug 17, 2013
getting error with gcc under OSX.
Code:
/* bmi2.c */
#include <stdio.h>
main()
{
float height, weight;
printf("Enter weight:
");
[code]....
View 2 Replies
View Related
Feb 27, 2014
I am writing a program that has many header files and their corresponding implementation files. I collected all the header files in a folder and did same for the implementation files into another folder. I'm using the Dev C++ IDE; I could add the files one by one to the project. Instead of doing this however, I tried adding the two folders to the project; but, the project did not compile!! The compiler could not find the files resident in each of the folders!
How I can add the folders to the project so that the internal files are visible to the compiler; or do I have to go the longer route of adding the internal files individually??
View 4 Replies
View Related
Mar 29, 2014
I'm trying to write a piece of code that calculates the difference in days between two manually input dates. The part of my code that's causing problems is:
xxx
When running the code and prompted to enter the date, if I input for example 31/12/2014, it'll be rejected and send me back to the beginning of the loop. Any date with 31 days involving months 1, 3, 5, 7, 8, 10 or 12 causes this problem. All other valid dates however work perfectly fine (e.g. 30/4/2014).
Something possibly worth mentioning is that, when I take out all other conditions from the loop, i.e.
xxx
it works fine (31/12/2014 is accepted), but of course I need all of the other conditions in there too.
View 1 Replies
View Related
Mar 1, 2015
I want to get the row and column of an Control that has been added to a TableLayoutPanel. This is what i've got so far:
I add the control at the begin in the Form_Load event:
this.tableLayoutPanel1.Controls.Add(this.userControl1, 1, 1);
private void tableLayoutPanel_Content_ControlAdded(object sender, ControlEventArgs e) {
int column = tableLayoutPanel1.GetPositionFromControl(e.Control).Column;
int row = tableLayoutPanel1.GetPositionFromControl(e.Control).Row;
if(row == 1 && column == 1) // Later i want to check it like this
}
The problem is, that the column and row are always 0, but why?
View 6 Replies
View Related
Feb 15, 2013
I'm getting an error when I want t add a file to my dataGridView that I can't add any data because it is databound. I've been working around this but still gives me the same error. heres the snippet of the code:
private void btnOpenLog_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
{
String sLine = "";
[Code] ....
View 18 Replies
View Related
Aug 27, 2013
In my c project in code blocks , I have added another source file (KillerMoves.c) and a header file under the same name (KillerMoves.h). I added the "include guard" to prevent double inclusion. But from some reason, the program suddenly crashes with no warning or specific error. Without the new files,the program runs without any problems. This is the source .c file:
Code:
#include "KillerMoves.h"
void initKillersTable(){
for(int i = 0; i < 15; i++){
killersTable[i] = -1;
[code]....
View 11 Replies
View Related
Jan 26, 2013
You are given 3 integers x,y,z. you must find all groups of x integers until y, that when added give a sum of z.
View 2 Replies
View Related
Nov 6, 2014
I've been struggling with an object when trying to add it to a list with [Listname].push_back. You see, I have a list with some objects that will be rendered in the screen (Called objects) and a function to create a text box with some text. The function in question is the following:
void reprEv(int evNum, ALLEGRO_BITMAP *txtbxim) //Event to call, default text box image.
{
textBox *txtBox = new textBox("Line 1 ", "Line 2 ", "Line 3 ", "Line 4 ", "Line 5 ", textboximage);
objects.push_back(txtBox);
[Code]....
(txtNum is increased then space is pressed, and when certain screen (maxScreen) have been shown, then it will go to the playing state)
My problem begins when the text box is created, because it's supposed to add only 1 text box to objects list, but instead adds hundreds of text boxes to objects.
View 1 Replies
View Related
May 25, 2014
Why is the size of an empty class 1? Why is the class still one when I add a char member to the class?//using turbo c++ 3.0, yes I know I'm using a very old c++ compiler and software
View 3 Replies
View Related
Oct 4, 2014
I have 3 columns already made Product, Price, Quantity, - what I want to do is take the textbox's txtName, txtPrice, txtQuantity, and add them to the columns in the right specific places.
View 2 Replies
View Related
Mar 31, 2015
I have a VC solution . This solution contain 1 execute project and 10 library projects. The libraries added to the execute project by
#pragma comment(lib,"../outputbin64/lib/mylib").
When i comment these lines to not be added these libraries to the execute project , i will have link error like this :
LINK : fatal error LNK1104: cannot open file '../outputbin64/lib/mylib.lib'
My library projects not added to execute project with another way.
My question is why the execute project will link the libraries that not added to project programmatically?
View 7 Replies
View Related
Apr 10, 2015
I am having some trouble creating a listbox in visual studio. I declared an array, set initial values, and now I would like to be able to update those values. It is a pizza inventory app, so I need to update the initial values once the user has added inventory. This is the code I have for the "Update Inventory" button:
// read in value and convert to double
double dblInput = Convert.ToDouble(txtInput.Text);
// loop through ingredients and add inventory to selected ingredient
for (int i = 0; i < dblInventory.Length; i++) {
// is item at i checked for update?
if(lstInventory.GetItemCheckState(i) == CheckState.Checked)
[Code]....
View 11 Replies
View Related
Apr 18, 2013
This is for excel . I have a form with 2 combobox and 1 textbox ...
combo 1 : user can select a column ; let say column A
combo 2 : user can select an operator ; let say = (equal)
textbox : user can enter value ; let say 2
so my code is like
if (column A == tb.text) {
execute code here
}
but the problem i have is during run time i allow user to add more controls to the form
if ((column A == tb.text) && (column B == tb2.text)) && //may be more if user add {
execute code here
}
how do i handle this 'cause, how many will the user add to it, and the code should change when user add new control to it.
View 1 Replies
View Related
Feb 17, 2013
How would I by any means print out the result of one number being added by two numbers 999999 times, the numbers both happen to be about 16500 digits long. It must display ALL digits in the number (all the digits the result ends up being). I know I can't use normal data-types, so what do I do?
Looks kinda like this:
for (int i = 0; i < 999999; ++i)
{
total += a;
total += b;
}
a and b being 2 different numbers with about 16500 digits.
View 2 Replies
View Related
Feb 9, 2013
I have an assignment where i have to make a palindrome program. As you can see i have already done the basic palindrome prog, however i am now stuck since the program goes into a infinite loop whenever a word with whitespaces is added.
I have also tried searching for methods online however they do not seem to work for me...
void CPali::check() {
length = strlen(palin);
for (int i = 0, p = length-1; p>i; i++, p--) {
if (palin[i] == ' ')
[Code] ....
View 6 Replies
View Related
Feb 18, 2014
Basically I need to make a program which asks for a business name and then keeps asking for more until user doesn't want to. Once more than 1 business is enter it should display the business and sort it alphabetically and keep displaying them each time another is added. I am lost on how to store the added business, sorting it and displaying the list.
Here is what I have so far.
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main () {
string business_name;
char selection;
[Code] .....
View 5 Replies
View Related
Aug 23, 2014
I have tried writing a code which takes two numbers from the user and calculates their square root then the roots are added up to return the sum. The program is coming out with loads of errors.
#include<iostream>
#include<cmath>
float main(){
using namespace std;
float m1,m2,m3,m4,m5;
[Code] ....
View 4 Replies
View Related
Jan 19, 2013
SLD_ttf lib and I have been following the Lazy Foo' tuts on it but the text is not appearing. I have found out that it is not loading the font as I have added in the code saying if it has failed.
Code:
font = TTF_OpenFont( "lazy.ttf", 28 );
if( font == NULL )
{
return false;
}
i have saved this font in the project (project name/project name/lazy.ttf).
View 19 Replies
View Related
Jul 1, 2013
I am trying to display images on top of my Background image gui, so like buttons an stuff but the problem is that there not showing ontop. I can only get one of them to show
// includes
#include <windows.h>
#include <stdio.h>
#include "res.h"
// defines
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
[Code] ....
View 1 Replies
View Related