Why does the convolution function not print?
f(t)={t+3: t ∈[0,T].
0: otherwise}
Read in an integer value for T. Sample the function f(t) above, at t = 0, 1, 2 . . . T and write the values to a file ‘function.txt’.
Read the values from the file, and place them in an array.
Write a function called “convolution” which takes two arrays as arguments, calculates their discrete convolution and prints out the resulting function in two columns: index and convolution. Print the output both to the screen and to a file called ‘convolution.txt’. Your function should only do the calculation for indices corresponding to non-zero values of the convolution. Assume both functions are only nonzero between 0 and T. (hint: the convolution will only be nonzero between 0 and 2T- make sure you understand why.)
Call your function with both functions f and g given by the same array from part 1.
The formula for finding the convolution is
(f*g)[n] ∑ (f[m] g[n-m])
This is what I have so far. need help finishing it.
#include <stdlib.h>
#include <stdio.h>
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T];
x= T+1;
fptr = fopen("function.txt","r");
if (fptr == NULL)
{
printf("No such file!");
exit(0);
}
for (i=0; i<=x; i++)
{
F[i]= i+3;
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
printf("n");
fclose(fptr);
int sum;
for (c=0; c<2T+1; c++)
{
sum =0; g=c;
for(f=0; f<c; f++,g--)
{
if (f<=T && g<=T)
{
sum = sum + F [ ]* G [ ];
}
printf("convolution [%d] = %d",c, sum);
}
}
}
int main (void)
{
int x;
int T,F[x],G[x];
x= T+1;
printf("Enter the value of T: ");
scanf("%d",&T);
convolution(F,G);
return 0;
}
c
add a comment |
f(t)={t+3: t ∈[0,T].
0: otherwise}
Read in an integer value for T. Sample the function f(t) above, at t = 0, 1, 2 . . . T and write the values to a file ‘function.txt’.
Read the values from the file, and place them in an array.
Write a function called “convolution” which takes two arrays as arguments, calculates their discrete convolution and prints out the resulting function in two columns: index and convolution. Print the output both to the screen and to a file called ‘convolution.txt’. Your function should only do the calculation for indices corresponding to non-zero values of the convolution. Assume both functions are only nonzero between 0 and T. (hint: the convolution will only be nonzero between 0 and 2T- make sure you understand why.)
Call your function with both functions f and g given by the same array from part 1.
The formula for finding the convolution is
(f*g)[n] ∑ (f[m] g[n-m])
This is what I have so far. need help finishing it.
#include <stdlib.h>
#include <stdio.h>
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T];
x= T+1;
fptr = fopen("function.txt","r");
if (fptr == NULL)
{
printf("No such file!");
exit(0);
}
for (i=0; i<=x; i++)
{
F[i]= i+3;
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
printf("n");
fclose(fptr);
int sum;
for (c=0; c<2T+1; c++)
{
sum =0; g=c;
for(f=0; f<c; f++,g--)
{
if (f<=T && g<=T)
{
sum = sum + F [ ]* G [ ];
}
printf("convolution [%d] = %d",c, sum);
}
}
}
int main (void)
{
int x;
int T,F[x],G[x];
x= T+1;
printf("Enter the value of T: ");
scanf("%d",&T);
convolution(F,G);
return 0;
}
c
What isF[T],G[T];
supposed to do? Even ifT
was initialized before which it is not.
– Gerhardh
Nov 23 '18 at 7:53
1
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add/W3
.
– David C. Rankin
Nov 23 '18 at 7:56
add a comment |
f(t)={t+3: t ∈[0,T].
0: otherwise}
Read in an integer value for T. Sample the function f(t) above, at t = 0, 1, 2 . . . T and write the values to a file ‘function.txt’.
Read the values from the file, and place them in an array.
Write a function called “convolution” which takes two arrays as arguments, calculates their discrete convolution and prints out the resulting function in two columns: index and convolution. Print the output both to the screen and to a file called ‘convolution.txt’. Your function should only do the calculation for indices corresponding to non-zero values of the convolution. Assume both functions are only nonzero between 0 and T. (hint: the convolution will only be nonzero between 0 and 2T- make sure you understand why.)
Call your function with both functions f and g given by the same array from part 1.
The formula for finding the convolution is
(f*g)[n] ∑ (f[m] g[n-m])
This is what I have so far. need help finishing it.
#include <stdlib.h>
#include <stdio.h>
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T];
x= T+1;
fptr = fopen("function.txt","r");
if (fptr == NULL)
{
printf("No such file!");
exit(0);
}
for (i=0; i<=x; i++)
{
F[i]= i+3;
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
printf("n");
fclose(fptr);
int sum;
for (c=0; c<2T+1; c++)
{
sum =0; g=c;
for(f=0; f<c; f++,g--)
{
if (f<=T && g<=T)
{
sum = sum + F [ ]* G [ ];
}
printf("convolution [%d] = %d",c, sum);
}
}
}
int main (void)
{
int x;
int T,F[x],G[x];
x= T+1;
printf("Enter the value of T: ");
scanf("%d",&T);
convolution(F,G);
return 0;
}
c
f(t)={t+3: t ∈[0,T].
0: otherwise}
Read in an integer value for T. Sample the function f(t) above, at t = 0, 1, 2 . . . T and write the values to a file ‘function.txt’.
Read the values from the file, and place them in an array.
Write a function called “convolution” which takes two arrays as arguments, calculates their discrete convolution and prints out the resulting function in two columns: index and convolution. Print the output both to the screen and to a file called ‘convolution.txt’. Your function should only do the calculation for indices corresponding to non-zero values of the convolution. Assume both functions are only nonzero between 0 and T. (hint: the convolution will only be nonzero between 0 and 2T- make sure you understand why.)
Call your function with both functions f and g given by the same array from part 1.
The formula for finding the convolution is
(f*g)[n] ∑ (f[m] g[n-m])
This is what I have so far. need help finishing it.
#include <stdlib.h>
#include <stdio.h>
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T];
x= T+1;
fptr = fopen("function.txt","r");
if (fptr == NULL)
{
printf("No such file!");
exit(0);
}
for (i=0; i<=x; i++)
{
F[i]= i+3;
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
printf("n");
fclose(fptr);
int sum;
for (c=0; c<2T+1; c++)
{
sum =0; g=c;
for(f=0; f<c; f++,g--)
{
if (f<=T && g<=T)
{
sum = sum + F [ ]* G [ ];
}
printf("convolution [%d] = %d",c, sum);
}
}
}
int main (void)
{
int x;
int T,F[x],G[x];
x= T+1;
printf("Enter the value of T: ");
scanf("%d",&T);
convolution(F,G);
return 0;
}
c
c
edited Nov 23 '18 at 7:45
Rai
9893822
9893822
asked Nov 23 '18 at 4:17
Aw HuAw Hu
1
1
What isF[T],G[T];
supposed to do? Even ifT
was initialized before which it is not.
– Gerhardh
Nov 23 '18 at 7:53
1
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add/W3
.
– David C. Rankin
Nov 23 '18 at 7:56
add a comment |
What isF[T],G[T];
supposed to do? Even ifT
was initialized before which it is not.
– Gerhardh
Nov 23 '18 at 7:53
1
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add/W3
.
– David C. Rankin
Nov 23 '18 at 7:56
What is
F[T],G[T];
supposed to do? Even if T
was initialized before which it is not.– Gerhardh
Nov 23 '18 at 7:53
What is
F[T],G[T];
supposed to do? Even if T
was initialized before which it is not.– Gerhardh
Nov 23 '18 at 7:53
1
1
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add
-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add /W3
.– David C. Rankin
Nov 23 '18 at 7:56
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add
-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add /W3
.– David C. Rankin
Nov 23 '18 at 7:56
add a comment |
2 Answers
2
active
oldest
votes
You have a bit of a mess in your variale declarations:
int main (void)
{
int x;
int T,F[x],G[x]; <==== x is not initialized. You define arrays of random length. Might be 0.
x= T+1; <==== T is not initialized.
printf("Enter the value of T: ");
scanf("%d",&T); <==== now T has a value but it is never used.
convolution(F,G);
return 0;
}
Then in the called function the same problems are repeated:
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T]; <=== T is not initialized; You access random elements of arrays of unknown random length.
x= T+1; <=== T is still not initialized.
Then desaster accelarates... ;)
for (i=0; i<=x; i++) <== x is T+1 (still uninitialized)
{
F[i]= i+3; <== With i going up to x which is T+1 you access index T+1 of an array of size [T] which is out of bounds.
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
You should start all over with your variables.
add a comment |
There are many uninitialized variables in your code. Reading them before writing into them causes undefined behavior.
For example, in main
the variable x
is uninitialized. You are using it for defining variable length arrays F[x]
and G[x]
.
In the convolution
function the vairiable T
is uninitialized. And you are using its value in the statement x= T+1;
This is undefined behavior. See this question and its answers for the reason.
And even if the initial value of T
happens to be 0, then the inner for
loop will not be reached as the value of c
cannot exceed 1.
T is already used inF[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
Inmain
, it is being used before being initialized.
– P.W
Nov 23 '18 at 7:58
Yes, and also inmain
it is already used before the statement you mention. It is used to define VLA of "random" length
– Gerhardh
Nov 23 '18 at 8:03
In main, itsF[x],G[x]
, notF[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?
– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440596%2fwhy-does-the-convolution-function-not-print%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have a bit of a mess in your variale declarations:
int main (void)
{
int x;
int T,F[x],G[x]; <==== x is not initialized. You define arrays of random length. Might be 0.
x= T+1; <==== T is not initialized.
printf("Enter the value of T: ");
scanf("%d",&T); <==== now T has a value but it is never used.
convolution(F,G);
return 0;
}
Then in the called function the same problems are repeated:
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T]; <=== T is not initialized; You access random elements of arrays of unknown random length.
x= T+1; <=== T is still not initialized.
Then desaster accelarates... ;)
for (i=0; i<=x; i++) <== x is T+1 (still uninitialized)
{
F[i]= i+3; <== With i going up to x which is T+1 you access index T+1 of an array of size [T] which is out of bounds.
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
You should start all over with your variables.
add a comment |
You have a bit of a mess in your variale declarations:
int main (void)
{
int x;
int T,F[x],G[x]; <==== x is not initialized. You define arrays of random length. Might be 0.
x= T+1; <==== T is not initialized.
printf("Enter the value of T: ");
scanf("%d",&T); <==== now T has a value but it is never used.
convolution(F,G);
return 0;
}
Then in the called function the same problems are repeated:
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T]; <=== T is not initialized; You access random elements of arrays of unknown random length.
x= T+1; <=== T is still not initialized.
Then desaster accelarates... ;)
for (i=0; i<=x; i++) <== x is T+1 (still uninitialized)
{
F[i]= i+3; <== With i going up to x which is T+1 you access index T+1 of an array of size [T] which is out of bounds.
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
You should start all over with your variables.
add a comment |
You have a bit of a mess in your variale declarations:
int main (void)
{
int x;
int T,F[x],G[x]; <==== x is not initialized. You define arrays of random length. Might be 0.
x= T+1; <==== T is not initialized.
printf("Enter the value of T: ");
scanf("%d",&T); <==== now T has a value but it is never used.
convolution(F,G);
return 0;
}
Then in the called function the same problems are repeated:
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T]; <=== T is not initialized; You access random elements of arrays of unknown random length.
x= T+1; <=== T is still not initialized.
Then desaster accelarates... ;)
for (i=0; i<=x; i++) <== x is T+1 (still uninitialized)
{
F[i]= i+3; <== With i going up to x which is T+1 you access index T+1 of an array of size [T] which is out of bounds.
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
You should start all over with your variables.
You have a bit of a mess in your variale declarations:
int main (void)
{
int x;
int T,F[x],G[x]; <==== x is not initialized. You define arrays of random length. Might be 0.
x= T+1; <==== T is not initialized.
printf("Enter the value of T: ");
scanf("%d",&T); <==== now T has a value but it is never used.
convolution(F,G);
return 0;
}
Then in the called function the same problems are repeated:
void convolution (int F[ ] ,int G [ ])
{
FILE *fptr;
int i,j,T;
int x;
F[T],G[T]; <=== T is not initialized; You access random elements of arrays of unknown random length.
x= T+1; <=== T is still not initialized.
Then desaster accelarates... ;)
for (i=0; i<=x; i++) <== x is T+1 (still uninitialized)
{
F[i]= i+3; <== With i going up to x which is T+1 you access index T+1 of an array of size [T] which is out of bounds.
fscanf(fptr,"%d",&j);
printf("F[%d] = %dn",i,F[i]);
}
You should start all over with your variables.
answered Nov 23 '18 at 7:59
GerhardhGerhardh
4,1812726
4,1812726
add a comment |
add a comment |
There are many uninitialized variables in your code. Reading them before writing into them causes undefined behavior.
For example, in main
the variable x
is uninitialized. You are using it for defining variable length arrays F[x]
and G[x]
.
In the convolution
function the vairiable T
is uninitialized. And you are using its value in the statement x= T+1;
This is undefined behavior. See this question and its answers for the reason.
And even if the initial value of T
happens to be 0, then the inner for
loop will not be reached as the value of c
cannot exceed 1.
T is already used inF[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
Inmain
, it is being used before being initialized.
– P.W
Nov 23 '18 at 7:58
Yes, and also inmain
it is already used before the statement you mention. It is used to define VLA of "random" length
– Gerhardh
Nov 23 '18 at 8:03
In main, itsF[x],G[x]
, notF[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?
– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
add a comment |
There are many uninitialized variables in your code. Reading them before writing into them causes undefined behavior.
For example, in main
the variable x
is uninitialized. You are using it for defining variable length arrays F[x]
and G[x]
.
In the convolution
function the vairiable T
is uninitialized. And you are using its value in the statement x= T+1;
This is undefined behavior. See this question and its answers for the reason.
And even if the initial value of T
happens to be 0, then the inner for
loop will not be reached as the value of c
cannot exceed 1.
T is already used inF[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
Inmain
, it is being used before being initialized.
– P.W
Nov 23 '18 at 7:58
Yes, and also inmain
it is already used before the statement you mention. It is used to define VLA of "random" length
– Gerhardh
Nov 23 '18 at 8:03
In main, itsF[x],G[x]
, notF[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?
– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
add a comment |
There are many uninitialized variables in your code. Reading them before writing into them causes undefined behavior.
For example, in main
the variable x
is uninitialized. You are using it for defining variable length arrays F[x]
and G[x]
.
In the convolution
function the vairiable T
is uninitialized. And you are using its value in the statement x= T+1;
This is undefined behavior. See this question and its answers for the reason.
And even if the initial value of T
happens to be 0, then the inner for
loop will not be reached as the value of c
cannot exceed 1.
There are many uninitialized variables in your code. Reading them before writing into them causes undefined behavior.
For example, in main
the variable x
is uninitialized. You are using it for defining variable length arrays F[x]
and G[x]
.
In the convolution
function the vairiable T
is uninitialized. And you are using its value in the statement x= T+1;
This is undefined behavior. See this question and its answers for the reason.
And even if the initial value of T
happens to be 0, then the inner for
loop will not be reached as the value of c
cannot exceed 1.
edited Nov 23 '18 at 12:33
answered Nov 23 '18 at 5:09
P.WP.W
16.8k41555
16.8k41555
T is already used inF[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
Inmain
, it is being used before being initialized.
– P.W
Nov 23 '18 at 7:58
Yes, and also inmain
it is already used before the statement you mention. It is used to define VLA of "random" length
– Gerhardh
Nov 23 '18 at 8:03
In main, itsF[x],G[x]
, notF[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?
– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
add a comment |
T is already used inF[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
Inmain
, it is being used before being initialized.
– P.W
Nov 23 '18 at 7:58
Yes, and also inmain
it is already used before the statement you mention. It is used to define VLA of "random" length
– Gerhardh
Nov 23 '18 at 8:03
In main, itsF[x],G[x]
, notF[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?
– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
T is already used in
F[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
T is already used in
F[T],G[T];
– Gerhardh
Nov 23 '18 at 7:53
In
main
, it is being used before being initialized.– P.W
Nov 23 '18 at 7:58
In
main
, it is being used before being initialized.– P.W
Nov 23 '18 at 7:58
Yes, and also in
main
it is already used before the statement you mention. It is used to define VLA of "random" length– Gerhardh
Nov 23 '18 at 8:03
Yes, and also in
main
it is already used before the statement you mention. It is used to define VLA of "random" length– Gerhardh
Nov 23 '18 at 8:03
In main, its
F[x],G[x]
, not F[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?– P.W
Nov 23 '18 at 8:23
In main, its
F[x],G[x]
, not F[T], G[T]
. So T is not used there. In any case, what if T or x contains a negative value. What will happen to array declarations then?– P.W
Nov 23 '18 at 8:23
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
I just wanted to add that there are more problems with uninitialized variables earlier.
– Gerhardh
Nov 23 '18 at 8:55
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440596%2fwhy-does-the-convolution-function-not-print%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What is
F[T],G[T];
supposed to do? Even ifT
was initialized before which it is not.– Gerhardh
Nov 23 '18 at 7:53
1
Wonder how many warnings you have to ignore to get this code to compile. If you are using gcc/clang add
-Wall -Wextra -pedantic
compiler options to enable warnings, and if you are using VS, then add/W3
.– David C. Rankin
Nov 23 '18 at 7:56