User Profile

Collapse

Profile Sidebar

Collapse
dru
dru
Last Activity: Nov 10 '06, 07:19 PM
Joined: Sep 29 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dru
    replied to Reversing elements in an array
    in C
    no algorithim just have to figure out that what to put
    See more | Go to post

    Leave a comment:


  • dru
    started a topic Reversing elements in an array
    in C

    Reversing elements in an array

    Problem:
    Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of the array.

    Given an array a , an int variable n containing the number of elements in a , and two other int variables, k and temp , write a loop that reverses the elements of the array.

    Do not use...
    See more | Go to post

  • Anyone got an idea?
    See more | Go to post

    Leave a comment:


  • Just moving it to the top to make sure it doesnt get missed.
    See more | Go to post

    Leave a comment:


  • dru
    started a topic Need help with a print statement using arrays and structs
    in C

    Need help with a print statement using arrays and structs

    Code:
    int search(student_record db[], int count)
    {
    	int i;
    	char fname[30], lname[30];
    	printf("Enter the employees first name:\n");
    	scanf("%s",fname);
    	printf("Enter the employees last name:\n");
    	scanf("%s",lname);
    	printf("\n\n");
    	
    	for(i=0; i<count; i++)
    	{
    		if((strcmp(fname,db[i].firstname)==0) && (st
    ...
    See more | Go to post

  • dru
    replied to Reading data in from a file
    in C
    do you know another way?
    See more | Go to post

    Leave a comment:


  • dru
    replied to Reading data in from a file
    in C
    anyone got any ideas?
    See more | Go to post

    Leave a comment:


  • dru
    started a topic Reading data in from a file
    in C

    Reading data in from a file

    I am trying to read data in to a struct from a prototype

    My Code is:
    Code:
    void init(student_record db[],int *count)
    {
    	FILE *input;
    	char temp_str[30];
    	input = fopen("mydata.txt","r");
    	
    	while(!feof(input) && count<SIZE)
    	{
    		fscanf_s(input,"%s",temp_str);
    		strcpy_s(db[*count].firstname,temp_str);
    		fscanf_s(input,"%s",temp_str);
    ...
    See more | Go to post

  • dru
    started a topic Arrays
    in C

    Arrays

    Hi I have a question from ab ook im trying to understand but can't get it. If someone can shoot me in the right direction i would appreciate it.

    The question is:
    Assume that ip has been declared to be a pointer to int and that result has been declared to be an array of 100 elements. Assume further that ip has been initialized to point to an element in the first half of the array.

    Write an expression whose...
    See more | Go to post

  • dru
    replied to Easy True False Equation
    in C
    the return is the only part I dont understand
    See more | Go to post

    Leave a comment:


  • dru
    replied to Easy True False Equation
    in C
    I got this but I do now know hwo to return the answer true or false i know its 1 or 0

    int isEven(int x);
    {
    if (x % 2 == 0){return 1;}
    else {return 0;}
    }
    See more | Go to post

    Leave a comment:


  • dru
    started a topic Easy True False Equation
    in C

    Easy True False Equation

    Write the definition of a function isEven , which receives an integer parameter and returns true if the parameter's value is even, and false otherwise.

    So if the parameter's value is 7 or 93 or 11 the function returns false. But if the parameter's value is 44 or 126 or 7778 the function returns true.
    See more | Go to post

  • dru
    replied to How to have program re run?
    in C
    nevermind figured it out just used al oop statement and had it cal main()
    See more | Go to post

    Leave a comment:


  • dru
    started a topic How to have program re run?
    in C

    How to have program re run?

    say i ask in the program

    Would you like to do another calculation for another employee (enter y or n)?

    how do i do this so that it re runs the program?
    See more | Go to post

  • dru
    replied to Need help with function prototypes
    in C
    ok thankyou
    141 am here cya
    See more | Go to post

    Leave a comment:


  • dru
    replied to Need help with function prototypes
    in C
    nice!!!!

    If you have time a haev a few questions
    See more | Go to post

    Leave a comment:


  • dru
    replied to Need help with function prototypes
    in C
    awesome

    Code:
    #include <stdio.h>
    
    double get_input(); /* prototype to get the input from the user */
    double calculate(); /* prototype to calculate the deggres into celsius */
    void output(double);    /* prototype to give the output */
    
    double get_input()
    {
       double fahrenheit;
       printf("Enter the degrees in Fahrenheit:");
       scanf_s(" %lf",
    ...
    See more | Go to post

    Leave a comment:


  • dru
    replied to Need help with function prototypes
    in C
    when ran like that i get this error in my compiler

    1>------ Build started: Project: Celsisu2a, Configuration: Debug Win32 ------
    1>Compiling...
    1>Celsius 2.c
    1>f:\documents\ visual studio\celsius 2\celsius 2\celsius 2.c(43) : error C2198: 'calculate' : too few arguments for call
    1>Build log was saved at "file://f:\Documents\Vi sual Studio\Celsisu2 a\Celsisu2a\Deb ug\BuildLog.htm "...
    See more | Go to post

    Leave a comment:


  • dru
    replied to Need help with function prototypes
    in C
    why does it make it ask input 3 times?
    See more | Go to post

    Leave a comment:


  • dru
    replied to Need help with function prototypes
    in C
    Well I didn't try taht yet but I did try this and it works one problem though on my compiler for some reason it asks for degrees in farenheit 3 times before working any ideas here the code:

    Code:
    /********************************************************************************
     Name:Andrew Lichenstein        Program:Celsius2.c
    
     SS#:0287                       Total Points:50
    
     Due:09/13/2006
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...