Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(){
- float *temps1;
- float *temps2;
- float input = 0;
- int count = 0;
- temps1 = malloc(sizeof(float)*5);
- while (input != -100){
- printf("Enter temperatures (enter -100 when finished): ");
- scanf("%f", &input);
- temps1[count] = input;
- count++;
- temps2 = malloc(sizeof(temps1)*2);
- if(count == sizeof(temps1)/sizeof(float)){
- temps2 = temps1;
- free(temps1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement