- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
#include<stdio.h>
int main(void)
{
printf("No words can describe me ..... ");
main();
return 0;
}
- Interests
- Sleeping, Googling
- PC Specs
- P4, 2.8 GHz, 512 MB RAM
Hi. I picked up Dev C++ the other day after a while of not using it. Here's my question: I can't figure out what's wrong with my code Basically, the program prompts for a command. If the command starts with 'open:', then it puts the following character(s) within "<>"s. This … |
|
The computer is a binary beast. We want to go from the one-fingered digital box to the ten-fingered human being and convert binary to denary(base 10) numbers. This is how it works, for instance, binary 10010 is calculated as 1*16+0*8+0*4+1*2+0*1 = decimal 18. Just because it's easy, let's throw in … |
|
hi I need help with this problem. I have tried writting the program, i just can not get it to run properly. Please Write The Fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, 21, ... begins with the terms 0 and 1 and has the property that each … |
|
Hi all, Can anybody tell me how to calculate the order of a recursive function. Lets take factorial function. Without using recursion [COLOR=blue]int x =1;[/COLOR] [COLOR=blue]for(int i = 1;i<=n;i++)[/COLOR] [COLOR=blue] x = x*i;[/COLOR] In this case the order will the O(n) in terms of time and in terms of space … |
|
Hi, i've only been learning c++ for a couple days now, so im fairly new to it. :p. After I read the basic tutorials and got somewhat used to the c++ environment, I attempted to create a calculator and after trying to solve all of my errors, it became very … |
|
Hi all, Can anybody help me with a an algorithm to find the maximum subset sum in an array. It would be better if the solution is of O(n). [example: {5,-2,10,-4} the maximum is 5 + (-2) + 10 => 13]. |
|
I have executed the below programm on both C and C++ compiler and got different results [CODE]#include <stdio.h> int main() { const int a=10; int *p=(int*)(&a); *p = 20; printf("address of a=%u\t%d\n", &a,a); printf("address of p=%u\t%d\n", p,*p); return 0; } [/CODE] With C compiler I got the output address of … |
|
Hi I'm trying to create and use some basic socket. I made a code but the compiler reports an error. I'm using linux ( sys/socket.h library) The code is> [CODE] #include <iostream> #include <cstdlib> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <arpa/inet.h> #include <signal.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> … |
|
Hi All, Can we delete this pointer from a member function. I have written three programs to try this. The first two crashes at run time while the third doesn't. Can somebody explain me this????? 1) This crashes at run time. [CODE]#include <iostream> using namespace std; class Base { public: … |
|
Why cant we have a virtual constructor? All the materials give somewhat similar anwer to this question. "First the VPTR Pointer is initialised to it's proper VTABLE by the contructor which is automatically done by the compiler ,,,," or "You don’t ever want to be able to make a call … |
|
|
|
[code]#include <stdio.h> #define a b #define b a int main(void) { int a = 20, b = 30; printf("%d %d", a, b); } [/code] What will be the output of this programm ?????????????? Really confused with this ... Can somebody tell me what exactly will be happen and how macros … |
|
[code]#include<stdio.h> #include<string.h> #define size 21 #define max 5 int id[max][size]; char ln[max]; int pr[max]; int mt[max]; int fg[max]; void getrecord() { int i; for(i=0;i<=4;i++) { clrscr(); printf("id number:"); scanf("%d",id[i]); printf("last name:"); scanf("%s",ln[i]); printf("prelim:"); scanf("%d",pr[i]); printf("midterm:"); scanf("%d",mt[i]); fg[i]=(pr[i]*0.4)+(mt[i]*0.6); } getch(); } void displayreverse() { int i,p; clrscr(); printf(" idno. lstnme prelim … |
|
hi.. i would like to compare a user-input string with another string to see if they matched so what should i do? sample code: [CODE] getline(cin,string); if((i==25)&&([I]string comparsion here[/I])) do this; else if((i==25)&&([I]similar string comparison[/I])) do something else; [/CODE] so what should i do? i tried [CODE]const char* str = … |
|
[CODE]# include<iostream.h> void main() const int m=3; const int n=4; const int p=5; int A[m][n]; int B[n][p]; { cout<<"3x4 matrix"; for(m=0; m<3; m++) { for(n=0; n<4; n++) cin>>A[m][n]; cout<<A[m][n]<<"\t"; } cout<<"\n"; cout<<"4x5 matrix"; for(n=0; n<3; n++) { for(p=0; p<5; p++) cin>>B[n][p]; cout<<B[n][p]<<"\t"; } cout<<"\n"; int d, c=0; for(m=0; m<3; m++) … |
|
is it possible to change the space into underline? coz i don't know how to program that in C... please help!! |
|
I have to write a function which takes an integer array as input and it should return true if the array contains 1,2,3 or 4. Conditions 1) The function should pass thru array only once. 2) Can use two local variable. 3) Preferably using bit manipulation. Now suppose if the … |
|
I have a question. I'm writing a small program in c++ for my kid to help her with maths and to teach myself how to program. I'm using srand() to get a few random numbers for her to divide with the number she choose. All is fine until I get … |
|
[code] { int input; cout<<"Please select a number from 0 to 127: "; cin>>input; if (input<127 && input>0) MarkNumber(input); else cout<<"Please enter a number from 0 and 127!"<<endl; } void MarkNumber(int input) { int loop=0, n=0; while (loop!=input) { cout<<n; n++; //incrementing number from 0 loop++; //incrementing counter for loop … |
|
Hi all. I am new to C, at least to the concept of pointers. I am trying to write a process scheduling simulator for my operating systems class (at the last minute of course). Anyway, I wrote a program just using arrays and got it to compile but then of … |
|
I've been trying to fix this code for 2 days now and i still don't understand where the error is coming from. this is my stackLL.h file [code] #include<iostream> using namespace std; class Node { public: int data; Node *link; }; class stackLL { public: stackLL(); ~stackLL(); bool isEmpty(); bool … |
|
[code]#include <iostream> using namespace std; class Exercise { public: int a; Exercise(){cout<<"constructor\n";} Exercise(const Exercise& x) { cout<<"copy constructor\n"; a = x.a; } Exercise& operator= (Exercise &x) { a = x.a; cout<<"assignment operaor\n"; return *this; } }; Exercise fun(Exercise& ); int main(void) { Exercise y; Exercise z; z = fun(y); return … |
|
[CODE]void main(void) { char *p = "name"; p[0] = 's'; printf("%s", p); }[/CODE] The above piece [COLOR=black]of code is giving me eror at run time. The reason for this error might be that I am not allocating any memory for the pointer(correct me if I am wrong).[/COLOR] [COLOR=black]My doubt is, … |
|
hai , i am chandu. i have some doubts in datastructures.can anyone help me to solve them 1) what datastructure (stack,queue.list......) is used for NOTEPAD ,(i want the best datastructure) and why? 2)what is the best datastructure used for MICROSOFTWORD and why? 3)how can we delete duplicate elements in an … |
|
Hi all, What is the effficient way to check whether a single linked list is looped somewhere.The number of nodes in the list is not known. In that case traversal of SLL will go into an infinite loop. One solution I have is to store each address of node in … |
|
i have an assignment at school where we have to get a string entered by a user and then the program is supposed to encrypt it by adding 13 to A-M and -13 from M-Z so that if i inputted A B C i would get N O P. Basically … |
|
My C program for making a database which stores data and from which data can be retrieved is stated later.But I am not able to write the function for editing the stored items correctly.Please suggest a method.Also suggest :[B]1.mode in which file is to be opened in case 2 of … |
|
double new_amount; printf("enter new_amount:"); scanf("%lf",&new_amount); printf("Amount entered is%lf",new_amount); |
|
i kow c up to a good level but i have question for which i am anable to find solution that is to find greatest of 2 numbers in 'c' without using 'if' condition can any one help me out |
|
I have hard time understaning of what is Inheritance? Can someone help on this? |