#include <cstdlib>
#include <iostream>
using namespace std;
struct height {
int feet, inches;
[Code] .....
I'm getting a succeed when i try to compile but my grow function is throwing me an warning that the + and - don't work in regards to grow function.
Basically i want it to grow a certain amount of inches specified and format the foot and inches if it goes over a foot. Can i not just add 1 to feet as it's an int? The same goes with inches.
I was attempting something weired with address to move data around when I discovered that the size of the array is not what I expected. I am passing this structure as &Users to a function that declares it as a void *, then I can deal with chunks of data (memmove) and not have to worry about index or things like that. However...sizeof is returning something I do not understand.
Im having trouble creating a struct within a struct node. the program suppose to hold students firstname, lastname, and gpa in a node therefore creating my linked list. Line 26 keeps saying that cannot convert parameter 2 from 'studentType to std::string
error: request for member 'character' in '* ptr', which is of non-class type 'datastructure*' error: request for member 'character' in '* ptr', which is of non-class type 'datastructure*'
These errors are related to " *ptr->character='a'; printf("Ptr: %c",*ptr->character); "
I want to access "character" data inside the structure "trial" by a pointer to pointer "ptr" inside function "function",but I couldn't find a way to do this.
I just read and have known for a while that classes are private (members and inheritance) by default and structs are public. But my question then comes what if.. a struct inheriting from a class or a class inheriting from a struct?
so here is a basic program i wrote i am thinking of writing a currency conversion program that does multiple conversions and i was thinking it is possible to do something like this couldnt i call them after i write them as functions
usdtoeuro() usdtokuna()
how would i go about doing that? or can you point me to anything?
I wrote a program which detects a pattern in an array then returns a valve (x) for each time it does. now i tried to call function patt in main so that i can print x but it doesn't let me do it.
#include <stdio.h> int patt(const int SIZE, char str[], int i, int c); int main(void) { const int SIZE=21; char str[SIZE]={'1', '0', '1', '1', '0', '0', '1', '0', '1', '0', '1', '0', '0', '0', '1', '0', '1', '1', '0', '1'}; int i, c=0;
I want to write a function and be able to call it during execution (say during a while(1) loop). Is this possible without having to parse an input string to extract the function and parameters I need or is that the only way?
My program is crashing when I'm trying to call b = a. What has me confused is that when I call c = d = b, it all works fine.
I actually think I see it now that I posted this. In operator= I'm changing the size, but I'm not changing the size of the array that it's pointing to correct? I'm keeping it as 'p = new T[size]' rather than changing it to 'p = new T[x.size]' correct?
#include <iostream> #include "Array.h int main() { std::cout << "creating Array< int > object a ...
i think my function call is not working and i dont know how to fix it. Basically i want it to output my getstudent function and once i get the information i want it to output with the displaystudent.
I am trying to input a call by value in the second class. It will not compile with how it is currently and says that the pounds needs to be a different variable. Why is this? Is this close to a call-by-value or am I way off?
#include <iostream>; using namespace std; int main() { int a, b, c, d; cout << "Please enter your weight in Pounds and Ounces ";
When I call the member function in the main function, two functions are working fine but the third one(print()) is not. The program stops after executing the read_ages function and nothing printed on the screen. This is really strange and I could not find any problem after spending hours and had to post it here.It is a very simple program but I cant find the bug. It is a multiple file program and I am using MinGW as a compiler.
//File 1
#include<vector> #include<string> class Name_pairs { private: std::vector<std::string>names; std::vector<double> ages;
[Code] ...
//I haven't made the sort function yet since I am stuck with the print(). Seems //like the compiler is skipping the print() function.