Why does this code output 2.Isn't it illegal to declare the same function again.
#include <stdio.h>
void foo();
int main()
{
void foo(int);
foo(1);
return...
Type: Posts; User: narendrav
Why does this code output 2.Isn't it illegal to declare the same function again.
#include <stdio.h>
void foo();
int main()
{
void foo(int);
foo(1);
return...
Oh.i did not take them into account.
And there is no guarantee that i find 'm' in that location.
Like i said as data changes value at that location changes.
how to go that exact location?
I have a file "data.txt" with following content
mark zuckerbergsiliconvalcalifornia
jimmy wales london unitedking
As you can see every record is on new line and size of each...
Hi.I am trying to implement BST using templates.
This is the code that i have written.
template <class T>
struct node
{
struct node *left;
T info;
I created and initialized a multi dimensional array as follows:
int arr[3][2] = {{1,2},{3,4},{5,6}};
when i wrote down the following line, it printed the value 4.
ok..thanks for the explanation..
i read the FAQ which said absolutely the same thing..
"The behaviour cannot be determined..."
But it is the first time i came across this kind of question.
so i...
went through the FAQ but still cannot determine the logic in my program..
can you please post a little explanation..
i wrote the following program and it's output is 14.
#include <stdio.h>
main()
{
int i=5;
@@laserlight,@@Matticus ,@@Salem,@@phantomotap
Thanks for your help.
I have now sorted it out.
But today i learnt something about "scanf" which i did not know earlier.
Once again thanks for...
@@laserlight ..
i am sorry.. i was stupid not to notice it..
thanks for pointing it out.
But i still dont understand this
if(scanf("%d",&num) == 1)
Is it the number of successfully read...
this is the program that i wrote ... for adding the digits in a number..
I USED THE CODE GIVEN BY SALEM TO WRITE THE PROGRAM.
Somehow it's not working..
#include <stdio.h>
#include...
@@phantomotap..
A small program PLEASE..!!
it would help me a lot..!!
Thank you.
I did not get you.on the above statement.
can you please show me a small program on how to check user input.
i want the user to tell
1.if he enters a character..i want to tell him to enter only...
Hi..
i have a doubt..
i have seen that isdigit() function is used with "character" data type..
but can we use to validate an "integer"...??
i mean is it ok..to write like this..
int num;...
ok...ok...references are really a little confusing for me...
yeah..i know when we use pass by reference then in while calling we use...
swap(&m,&n)
and while recieving it we use..
void swap(int *p,int *q)
while calling the function we just said..
swap(m,n)
.
.
which means we are actually passing the values of m and n
....
This is a program to swap two numbers...implemented using template...
#include <iostream>
using namespace std;
template <class T>
void swap(T &x, T &y)
{
thanks..for the reply..
but i dont know what does this isprint function does..
can you please explain..
hi..i am trying to write a small password program..this is the code i have written...
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
ok..thank you...very much..for the quick reply..!!!
hmm..i still dont understand..
are we trying to initialize the values of the memebers of the base class also..along with the members of the derived class..??
i was going through a program on run-time polymorphism and i encountered a program which had 1 base class and 2 classes derived from the base class..
the base class is as follows
class media...
you have to use a condition..like..
if(3%2 == 1)
{
printf("A");
}
else
{
printf("B");
i want to read data of any type into an array....Is it possible..??
if possible how to do it..??