no i haven't showed him anything yet
but I guess I will. I lost 1 hour while taking the exam trying to understand the reason why he would do something like this
well about making the function...
Type: Posts; User: jackhasf
no i haven't showed him anything yet
but I guess I will. I lost 1 hour while taking the exam trying to understand the reason why he would do something like this
well about making the function...
i don't think it was a trick question because the problem was clear
it wanted us to transform this function into another function that uses no recursion but does the same thing
nevermind, i ll...
my friend, thanks for the answer
you should tell this to my professor
he put this problem on our exams today and it's DRIVING ME CRAZY
that's why im asking here
thanks again
hi thanks for the answer
i swear i ve spent more than 5 hours to understand what it does but i just can't
i can't understand why the output can be different when declaring the arrays in a...
ok I CANT understand the logic of this recursion
the function is this:
void f(int A[], int n, int B[]){
if (!n)
f(A,n-1,B);
thanks a lot :)
ok i understand why it gives -6 now
because we have 4 digits and the forth one is 1(<0) then it takes all the digits and changes them from 1010 to 0101 and adds 1 to the end so 0110
am i right?...
1 question:
#include <stdio.h>
struct foo{
int a:4;
};
thanks MK27
i have one more question
what's the probability of this variable to contain a normal string of 3 characters?
i mean if we would make printf("%s",x) what's the probability of this...
hi
if we have this code
char x[10];
just this code nothing else, can we know what there might be inside the elements of the array?
if you print an element for example printf("%c",x[5]) it...
hello guys im practicing my recursion skills and i found this problem somewhere
that wants to reverse a string recursively so if we have for example "abc" it will make it "cba"
this is my try
...
ofcourse i wanted to change things, but you kept saying that my code and thinking was wrong without telling me why
thanks again for the reply
True, but, i don't want to count numbers, that's why I did what I did and in this program if you have the fahrenheit 451 input, you will get 1 as a result, which is...
also for different inputs i get
" 1234 Hello world 2340923042 how are you " = 5
" 1234 Hello world asdasdasdasd asdas das da sd asd 2340923042 how are you " = 11
thanks for the reply, it was my fault not to say that we dont count numbers as words
new line characters, commas etc and punctuations will not be included in the string
also, why do you say...
hi everyone, i made this code but i'm not sure if it's 100% correct
#include <stdio.h>
#include <string.h>
int count(char x[]){
i think i return it
i have return count[0];
do you mean anything else?
hi thanks for the reply
but how can i do this without using the variable count? I used it to count the number of times the target appears in the specified array
yea i know what i meant is that i'm not using any for/while/do while loops inside the function to get the desired result
Write a recursive function that searches an array of integers of size N and returns the number of integers equal to a target value
so all i did was this:
#include <stdio.h>
#include...
thanks :)
this code works like this
lets say we have a string word' = "abcdabc";
and we want to erase a word that is included in word'
if word = "abc" we want to make word' = " d ";
i ve done...
why do we have to declare a string like
char *x = "...";
or char x[] = "...";
?
also if i say char x[];
let's say we have this code
main()
{
int k;
while (k!=0)
{
scanf("%d",&k);
thank you very much again :)