you can write class in C.
The compiler internally passes the object by reference as the first argument for every member function.
example:
say you have a class,
class X{
int funcX(int y);...
Type: Posts; User: sangi
you can write class in C.
The compiler internally passes the object by reference as the first argument for every member function.
example:
say you have a class,
class X{
int funcX(int y);...
No. I mean virtual functions in C.
We can implement classes in C too. Since there is no compiler support for classes in C, you need to program in such a way that it works like a class.
How to implement virtual functions in C??
How to write a program such that it will delete itself after exectution?
This is the code which gives the correct results. I have tried this.
#include<stdio.h>
int main(void)
{
int a[5],temp,i,j;
printf("ENTER ARRAY ELELMENTS:");
for(i=0;i<5;i++)
...
I think you call it a garbage value.
yaa. right. It won't work. sorry for that.
The swap should be between a[j] and a[i].
As the name of the board suggest, i would rather concentrate on technical help than giving suggestions on the style of postings.
You seem more interested in non-technical help!!!!!
These changes in the for loop will help.
for( i=0; i< 10; i++){
for( j=i; j < 10; j++) {
if( a[i] > a[j]) {
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
I understand that. I only want to know why an additional variable will overwrite the next variable in the stack??
goto is best avoided. Its better you go in for other options when available.
The problem is that you are not getting the new value of guess within the while
#include <iostream>
using namespace std;
int main()
{
int guess;
It doesn't compare. It returns pointer to first occurrence of x in ISVOWEL string.
Inline doesn't make any difference to your program except that it reduces the exceution( run) time.
You can try this out. It works.
<<< UNTAGGED CODE DELETED >>>
Yes, they both are different.
inline void hello() will result in the function call being replaced by the definition during compile time. Hence there will be no overhead involved in pushing the...
hey, I tried the same program with an additional int definition in the function foo. Now the data is getting corupted. Why is that?
#include <stdio.h>
char * foo(void);
int main()
{
char...
That makes sense. thanks.
Hey, I am not understanding what you are trying to do in the function foo you wrote
You got the syntax right. But in foo, you have created a character pointer that points no where and copied "hi" to...
It is said that, you should not return value that is created on stack. i.e the auto variable or the local variables. Can anyone tell me how the program below prints the right value "hi"???
char*...