Search:

Type: Posts; User: lancehumiston

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    3,322

    I was looking for a solution in c# programming....

    I was looking for a solution in c# programming. Thank you though.
  2. Replies
    4
    Views
    3,322

    converting string to ints

    I am working on an assignment to create a Complex number calculator. In this assignment I am to ask the user for input to the calculator. We are given a sample run output that looks like this.

    ...
  3. Replies
    3
    Views
    3,288

    can't believe i forgot to put that. thank you

    can't believe i forgot to put that. thank you
  4. Replies
    3
    Views
    3,288

    ostream operator overloading error

    Header file for base class

    #ifndef EMPLOYEE_H
    #define EMPLOYEE_H
    #include <string>
    using namespace std;

    class Employee
    {
    public:
  5. Replies
    9
    Views
    2,068

    //--- Definition of push() void...

    //--- Definition of push()
    void Stack::push(const StackElement & value)
    {
    Stack::NodePointer ptr;
    Stack::NodePointer prev;
    if(value%2==0)
    first = new Stack::Node(value, first);...
  6. Replies
    9
    Views
    2,068

    okay thanks that makes sense but even with the...

    okay thanks that makes sense but even with the new Stack being set to prev I'm still not receiving any odd integers in the output. Whether or not I put them at the begining, the end, or somewhere in...
  7. Replies
    9
    Views
    2,068

    ptr->next = new Stack::Node(value, NULL); like...

    ptr->next = new Stack::Node(value, NULL);
    like this?
    my program crashes when it tries to execute this line
  8. Replies
    9
    Views
    2,068

    I realized i didn't have ptr =...

    I realized i didn't have


    ptr = ptr->next;

    in my for loop but now I am not getting any odd data back when I call display?
    Here is the function for display as well


    //---...
  9. Replies
    9
    Views
    2,068

    linked list

    //--- Definition of push()
    void Stack::push(const StackElement & value)
    {
    Stack::NodePointer ptr;
    if(value%2==0)
    first = new Stack::Node(value, first);
    else{
    ptr =...
  10. Replies
    3
    Views
    3,329

    I'm writing my code in codeblocks 10.05. How...

    I'm writing my code in codeblocks 10.05. How would I change to a Console program?
  11. Replies
    3
    Views
    3,329

    'undefined reference to WinMain@16'

    I'm trying to compile my first program that uses a class file and am getting a "undefined reference to WinMain@16" error. Does anyone know how to fix this? Thank you!
  12. dynamic allocation of multidimensional array

    I am trying to allocate memory for a 2 dimensional array of size declared by the user but am not quite sure how to do this. I read several forums about it to generate the code I have so far but am...
  13. Replies
    7
    Views
    3,391

    #include #include using...

    #include <iostream>
    #include <vector>
    using namespace std;

    void MagicSquare ( double matrix, int n );
    void DisplaySquare ( int matrix, int n );

    int main(void)
    {
    int order;
  14. Replies
    7
    Views
    3,391

    sorry but now I am recieving a conflicting...

    sorry but now I am recieving a conflicting declaration error for that line?
  15. Replies
    7
    Views
    3,391

    I added that after reading 'order' and added...

    I added that after reading 'order' and added header #include <vector> but now it is saying template argument 1 and template argument 2 are invalid errors for that line?
  16. Replies
    7
    Views
    3,391

    two dimensional array

    I am trying to write a program that creates a magic square of two dimensions. The size of the array needs to be decided by the user so it can't be predefined. I've come across a few different ways to...
  17. Replies
    8
    Views
    6,451

    #include main() { int x; int r;...

    #include<stdio.h>

    main()
    {
    int x;
    int r;
    char response;
    srand( time(NULL) );
    do{
    printf("I have a number between 1 and 10.\n");
  18. Replies
    8
    Views
    6,451

    yeah i am unsure how to recieve their response,...

    yeah i am unsure how to recieve their response, is it possible with a scanf? if so, how do i store their response? scanf("%d?

    thank you i was getting an undefined symbol message but i put the...
  19. Replies
    8
    Views
    6,451

    how should i define NULL in srand( time(NULL) );?...

    how should i define NULL in srand( time(NULL) );? i thought unsigned was the correct way?

    Also i just went through the tutorial on loops and it didn't tell me anything about changing a user's...
  20. Replies
    8
    Views
    6,451

    i know where the loop needs to be my question was...

    i know where the loop needs to be my question was more along the lines of how do i create the loop while (?) and how do i use the user's respons (y or n) to return a true or false for the loop?
  21. Replies
    8
    Views
    6,451

    how do i make this loop???

    main()
    {
    int x;
    int r;
    unsigned NULL;
    printf("I have a number between 1 and 10.\n");
    printf("Can you guess my number?\n");
    printf("Please type your first guess.\n");
    scanf("%d", &x);
    srand(...
  22. Replies
    2
    Views
    6,237

    newline loop

    #include <stdio.h>
    #include <math.h>

    int isprime(int n);

    int main(void)
    {
    int i;
    int count=1;
    printf( "The prime numbers from 1 to 1000 are \n" );
Results 1 to 22 of 22