this code is giving a compilation error; I don't know what to change on the red highlighted line.
#include <stdio.h>
char * catstr(char * s1, const char * s2);
Type: Posts; User: Peachy
this code is giving a compilation error; I don't know what to change on the red highlighted line.
#include <stdio.h>
char * catstr(char * s1, const char * s2);
Basically the code prints out the binary equivalent to the number input by user. But I am failing to see how it prints a 1, exactly. I think when with the expression
putchar('0' + n%2);
the...
I need to write a definition of a function with all the following points to be addressed:
function name is Problem
it receives a parameter named b of the struct node * type
it creates...
I fixed the scanf call.
I use input of (7,3)
7th row of pascal's triangle, 3rd element
result should be 35 (i thought this was the 4th element, myself)
getting garbage output, why???
Code compiles okay.
But when I run program after I enter my values as asked,
get segFault. Why ???
I think my scanf and printf lines in main() might be the problem.
Please help.
I want...
I have three questions:
1) what is the best method of asking for user input of n and k values ? such as in the form C(1,2)
2) shouldn't the below code have an additional set of parentheses...
I need to write a RECURSIVE function to calculate binomial coefficients.
It has been 9 years since last I took a mathematics course.
I have forgotten the purpose of this formula:
C(n,0) = 1...
I am not understanding the following textbook question:
Suppose the following macro M is defined as such:
#define M 10
Which of the following tests will fail??
(a) #if M
(b) #ifdef M
ok so, say str[10] = "balance";
&str[1] will look at this as " alance "
not as " a " (the first 'a' in the string) ??
and str+1 will do the same as &str[1] ???
PINKO:
how is the string being access if there is no incrementation of
str ?? how is str[2] , str[3] being checked against ch??? I don't see where there is incrementation to next element of...
I am trying to follow the logic of the following program:
Is the mystery function in effect counting the # of instances a character variable shows up in a string? Please explain the code in the...
ok fixed the prototype problems
now I just need a little guidance in the loop needed to sort the strings input (words) into smallest to largest lengths. How do I do that?
What is the best...
Can someone reply with an answer to my original problem???
I need to understand the order of the function calls AND the loop involved to find the smallest to largest length string.
Got any...
why did you declare and define strlen() in your program
-----------------------
I suppose cause I didn't understand why my book had the function written out longhand, and didn't know what the...
program must let user input words
stops when length of word is 4 characters
keeps track of length of all words, prints out shortest and longest words
(part of the instructions say that the...
what is the following code doing, particularly in the *strcat1 function???
(1)explain to me the reason for two while loops,
(2)why does the first have just *p2 : no assignments or logical...
And so I check for NULL by
also checking for 0
char *strcpy (char *End, char *Begin)
{
char *s, *t;
Please I don't see the difference between an empty string
and NULL.
so no-one's code is complete???
the code states that while *s is not pointing to the NULL
*s increments to next char in string and copies to t ??
when *s finally gets to the NULL loop stops...
please explain strcpy command !!!!!!!!
is the following a valid function ??
char *strcpy (char *End, char *Begin)
{ char *s, *t;
Stoned Coder ---------
Thanks for the step by step, however,
The original question was:
what will be the contents of the array SORT after the following statements are done??
And my...
I am just trying to understand the question??
pointers are a bugger to get and C depends on knowing
arrays and pointers.
what will be the contents of the array SORT after the following statements are done??
#define ELEMENTS 7
int SORT[ELEMENTS] = {2,4,6,8,10,12,14};
int *s = &SORT[0], *t = &SORT[ELEMENTS...