Provided that a & b are integers,
Why this works for calculating XOR:
a^b
but this doesn't:
Type: Posts; User: smrtshrm
Provided that a & b are integers,
Why this works for calculating XOR:
a^b
but this doesn't:
thanks for pointing it, I took the wrong channel.
why we can't know the size of a function? Read about stack frame and what happens when a function is called -> then it will be clear (if not then further discussion can lead to conclusion). ...
It is continuously taking the first input again and again (even if I am just pressing ENTER) - What exactly is scanf reading from the Stream?
#include<stdio.h>
int main()
{
...
nope!! I am still weak in c
"k" is just for indicating if the linked list whether it contains odd or even number of terms, if odd then there will be only one middle element else two middle elements.
here is my logic: pointer "two" walks with twice pace when compared to pointer "one", when pointer "two" reaches the end, pointer "one" reaches the mid. since bothe pointer "one" & "two" are...
Through this program I want to find the middle element of the linked list but it is not working:
#include<stdio.h>
#include<stdlib.h>
struct node
{
int i;
struct node *next;
thanks for the help.
When I run this code:
#include<stdio.h>
int main()
{
char i[6];
int k;
fgets(i,15,stdin);
Thanks for pointing me into right direction.
In this program, on using sizeof to compute no. of elements in array x, it works fine:
#include<stdio.h>
int main()
{
int x[5]={23,54,3,5,6};
int...
Thanks a lot. you have saved me from all the confusion related to that algo :)
You can understand pointers from this:http://www.cs.cf.ac.uk/Dave/C/node10.html - little practice will be enough for clarity.
If you are new to linked list then please try to break the code...
Run this:
Even declaration of num outside main() and fmax() will work.
#include <stdio.h>
#include <stdlib.h>
//prototype
int fmax(int a[], int n);
Looks convincing, I'll try that and see if it works.
in main function declare
int num;
pass array to the function fmax by sending the address of 1st element of array & access its elements with help of pointer -->
Method:
printf("Maximum:...
Symbol <-----> In-Stack Priority <------> In-coming Priority
+- <-----------------> 2 <-----------------> 1
*/ <-----------------> 4 <-----------------> 3
^ ...
thanks a ton!!
I have made a program for converting infix to postfix notation (provided not more than 2 operands and 1 operator may reside within single () ), the program takes first input as number of infix...
I am using linux & the compiler is gcc.
any non-standard method which you can suggest? all I get is "implicit declaration of function ‘getch: undefined reference to `getch'
collect2: error: ld returned 1 exit status’"
If I use scanf() to read standard single character input then ENTER is needed to read next character, in case of getchar() it echoes the input on screen, is there anything which takes input without...
Lets say the file you have to read is T.txt, the methods for you to solve this problem is:
Traverse the file, store the integer somewhere & while traversing insert each ASCII character into a...
What problem are you facing in designing the code?