Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. solardude

    Copy an array using a function

    #include <stdio.h> void copyArray (int srcArray[], int srcSize, int dstArray[], int dstSize); int main(int argc, char **argv) { int i = 0; int srcSize; int srcArray[15]; int dstSize; int dstArray[15]; int c=0; //Enter array sizes printf("Enter the source size: ")...
  2. solardude

    Copy an array using a function

    The program doesnt allow me to input anything into the array. It goes straight to printing the source array and skips the while loop entirely. I dont get what im doing wrong.
  3. solardude

    Copy an array using a function

    I fixed up the loops thanks for the help. If I wanted to stop when the user has inputed the data they want how would I do that? I tried to do this code but for some reason my c is automatically equaling new line. while (c != '\n') { c = getchar(); if (i < srcSize) { srcArray[i] =...
  4. solardude

    Copy an array using a function

    My attempt is a screw up. I dont know where to set the size of the arrays. I dont know how to use functions properly either. #include <stdio.h> void copyArray (int srcArray[], int srcSize, int dstArray[], int dstSize); int main(int argc, char **argv) { int i = 0; int srcSize; int...
  5. solardude

    Copy an array using a function

    I thought use: void Arraycopy (int sourceArray[], int sourceSize, int destinationArray[], int destinationSize)
  6. solardude

    Copy an array using a function

    I need to copy one array into a different array using a function. However, if the source array has less elements than the destination array,the remaining elements in the destination array should be set to 0. If the source array is bigger than the destination array, I need to copy only as much...

Part and Inventory Search

Back
Top