Okay..is there any way to override that and keep the loop running until a char input 'n' is entered?
Type: Posts; User: Sylar Persie
Okay..is there any way to override that and keep the loop running until a char input 'n' is entered?
In the following code snippet
while(1)
{
char c;
printf("enter y/n");
c=getchar();
if(c=='y')
Im sorry.I think I explained poorly.It returns 1 if one of the strings is a substring of the other.And,it is not an implementation of the substr function.
Hi! Is the complexity of this function linear? If not,what is the complexity?Also,does this work for all test cases?Any suggestions would be helpful.Thanks!
It returns 1 if a match is found and 0...
Thanks laserlight...that's what i wanted to know:)
Ok...now,if i want to pass this char array to a function whose prototype is like
char *fn(char *c)
how can i pass this char array and return another char array back to main?
Why is this swapping wrong?
#include<stdio.h>
int main(void)
{
char *c="abcdefgh";
char d;
That's what i wanted to know..thanks a million dude:)
I don't know...i just copied the code from the following website
C String Substring
Dont understand how it works:(
#include<stdio.h>
int main(void)
{
char str[]="abcd";
int i=1,j=4;
char *ch=str;
printf("%.*s\n",j-i,&ch[i]);
That's what i wanted to know..Thanks a lot guys:)
I presume it is a keyword,globally used only by the compiler:)
Is it a reserved identifier?
Hi! I read the source code of strlen() function in a book called "The Standard C Library" and it is as follows:
/* strlen function */
#include <string.h>
size_t (strlen)(const char *s)
{...
What is wrong with the assignment p=a in this code?
#include<stdio.h>
int main(void)
{
int a[][4]={5,7,5,0,
4,6,3,1,
Thanks hk_mp5kpdw....that made things clear:)
I'm sorry,what does that mean?Could you elaborate?
What is a void pointer?Consider the following code snippet
#include<stdio.h>
void main()
{
float i=10,*j;
void *k;
k=&i;
...
Thanks oogabooga...seems like this code might be the one he asked for:)
Yes..he said that we are not supposed to use them.
I thought of it first too,but he said that i must print it all within this single function int fib(int n) recursively.Nothing extra.
Thanks laserlight:).... that really helped:)
Yes, I have.But I can't understand the idea of "using recursion to loop over array elements".What exactly is that?
I'm sorry,but im fairly new to programming in c.What do you mean by looping over the array elements?Could you explain with an example,if it's ok?
I am required to print the fibonacci series using a recursive function
int fib(int n) where n is the number of elements in the series.I pass this through main.And i am not allowed to use any loops...