I see. Thanks. Could you see if my code is right for recursive?
Type: Posts; User: unknownC
I see. Thanks. Could you see if my code is right for recursive?
main()
{
int n=0;
increase(n);
}
I have edited it. Is it recursive now? :tongue:
main()
{
n=0;
increase(n);
}
This recursive function is to display numbers from 0 to 10.
Am I doing it as recursive?
for(n=0;n<10;n++)
{
increase(n);
printf("%d ",a);
Thanks! It works!
I encounter this issue: "Run-time Check Failure #2 - Stack around the variable 'choice' was corrupted."
"choice" is a single character variable used in switch loop.
Any solution?
After using your code, an error message appeared: "a value of type "const char *" cannot be used to initialize an entity of type "char" ".
What about this?
typedef struct
{
char address[100]
int phone;
}contact;
typedef struct
Obviously it says error. Then please tell me what's the correct way of typing it.
Here's my code:
typedef struct
{
char address[100]
int phone;
}contact;
typedef struct
I have also thought of another way... Please advise which will be better.
while I read '*'
if I read '*'
continue;
else if I read '\n'
break;
For my instance, am I right at the following?
[CODE]while I am not at the first value of the line after '*'
if I read '*'
continue;
else if I read '\n'
break;[\CODE]
do
{
while ((c=fgetc(Pattern))!='*')
{
//read 1st pattern [1 1 1;2 2 2;3 3 3]
}
//compare with Matrix file
I still don't get it. Is it possible to instant messaging here? Or can someone send me an email at <<snipped>>? I don't want to post my homework script online.
if((c=fgetc(Matrix))=='*')
{
while (c=='*')
{
continue;
if(c=='\n')
break;
}
}
Here's my try...
if(c=='*')
{
while (c=='*')
{
continue;
if(c=='\n')
Are you referring to something like this?
if (c=='*')
{
c=c+4;
getc(Matrix);
}
I am trying really hard. PLEASE PLEASE HELP!
Is it possible to ask the program to read the line after a character?
For example,
1 1 1
2 2 2
3 3 3
*****
4 4 4
5 5 5
I have tried to change to %0.10f sec also no use. The super duper long program has a huge size for each for loops. :\
time_t start,finish;
time(&start);
a super duper long program
time(&finish);
printf("Time Taken: %.4f sec", difftime(finish,start);
I know about the value of b[c] part. It's just not shown here. Anyway, thanks. I will read up on array then will try again.
int a,b,c;
for (c=0;c<20;c++)
{
if (b[c]<100)
{
a=b[c];
}
}
How do I read/get value of c from here:
for loops
{
if loops
{
a=b[c];
}
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define size 25
main()