- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 43
- Posts with Upvotes
- 38
- Upvoting Members
- 26
- Downvotes Received
- 9
- Posts with Downvotes
- 9
- Downvoting Members
- 8
- Interests
- Dream to fly light weight plane someday. Love adventure, video games.
Re:
Hi, I would like to print the table of a number entered by the user like 2 *1=2 2*2=4 2*3=6 The code is [code=c]#include<stdio.h> #include<conio.h> main() { int i,num; printf("Enter any number"); scanf("%d",&num); for(i=1;i<=num;i++) printf("%d*%d=%d",num,i,num*i); getch(); }[/code] But this code is generating errors. |
|
Re:
[CODE]//To convert postfix expression into an expression tree #include"stdio.h" #include"conio.h" #include"process.h" #include"string.h" #include"stdlib.h" struct node{ char item; struct node *lnode; struct node *rnode; }*stc[30],*temp,*root; typedef struct node *NODEPTR; char expression[50]; char c; int top=0; NODEPTR pop(); void push(NODEPTR); void getinput(); void inorder(NODEPTR p); int main (){ getinput(); int i,j; for(i=0;i<strlen(expression);i++) … |
|
Re:
[CODE] ifstream in_gradebook; ofstream out_gradebook; in_gradebook.open("gradeBook.txt"); out_gradebook.open("gradeBook_edit.txt"); while (???) //while int is being read { in_gradebook >> score; out_gradebook << score << " "; sum = sum + score; } average = sum / 10.0; out_gradebook << average << endl;[/CODE] Here is a small snippet of the code I have … |
|
Re:
Could you please help me on this. i tried but i am getting segmantation fault. void qsort(char *v[], int left, int right){ int i, last; void swap(char *v[],int i,int j); if(left>=right) return ; swap(v,left,(left+right)/2); last = left; for(i=left+1;i<=right;i++) if(strcmp(v,v)<0) swap(v,++last,i); swap(v,left,last); qsort(v,left,last-1); qsort(v,last+1,right); } void swap(char *v[],int i,int j){ '... … |
|
Re:
Hi I am doing an assignment and my professor gave us the code for a copy function for a doubly linked list. The function should copy list into another empty list and if the list being copied is empty it should just return and exit. Here is the code my … |
|
Re:
Slot Machine I got all this so far !!! Nex is .. First build in support for writing output to an output file. 2 Make a copy of your existing program and modify the new program to be array based or to use functions or both. It does not have … |
|
Re:
I'm starting to write more intricate code that does some dynamic compilation through Lua and OpenGL. However, my code is starting to get kinda messy because I have many const char* strings and strings in sections of my code so they can be parsed together properly depending on specific conditions. … |
|
Re:
Hi friends, well... i'm asking for another help from you guys.hope you will... My friend sent me a email asking why the following code doesn't work properly.I'm also couldn't understand what's happening..When this program run it supposed to prompt two times to enter values.but its actually prompt once. I tried … |
|
Re:
Hi could someone please helping in starting this program? I am not asking anyone to do my work for me i just want to know how i can start the program and steps to follow please( i am new to c++) thanks write a program that reads an n*n matrix … |
|
Re:
Hello All I have on prog. in C which displays the text file in reverse order. I was in thinking that for text file reverse order means displaying text from end of file to beginning of file. in the same image will be rotated in 180 degree i.e. reverse the … |
|
Re:
I am currently working on a banking system that has 3 classes. customer, savingsAccount and transaction. I have created the 3 classes but am having problems with the saveAcnt object in the customer class. I need to link it with the savingsAccount class. Any help would be appreciated. Also I … |
|
Re:
char exe_str[]="find E:\sid -name 'sid.txt' -print"; How do i make find command here interactive... 1st. Accept the Drive letter from user 2nd Accept the file name from user thanks.. |
|
Re:
Hello , Please what does the second typedef statement do, [code] struct listnode{ char data; struct listnode *nextPtr; }; typedef struct listnode Listnode; typedef ListNode *ListNodePtr; [/code] what is the difference between [code] ListNodePtr *sPtr; and ListNodePtr startPtr; [/code] Please explain what the second Line of Code would do please … |
|
Re:
Dear friends: I wrote the following c++ codes to create a series of filenames as "iteration number.dat". [CODE]#include <iostream> #include<string> #include<sstream> using namespace std; int main() { string outbuffer; ostringstream outs(outbuffer); for (int i=0;i<5;i++) { outs<<i<<".dat"; cout<<outs.str()<<endl; } cout<<outbuffer; return 0; } [/CODE] I tried to use the ostringstream to … |
|
Re:
What wrong with my coding? when i run..nothing appear.. The output should be: Perimeter of Rectangle 1: 22 Perimeter of Rectangle 2: 6 Perimeter of Rectangle 3: 18 Perimeter of Rectangle 4: 4 [CODE]#include<iostream> using namespace std; const int TOTAL= 4; void CalculatePerimeter(int perimeter[], int width[], int height[]); //const int … |
|
Re:
hi, i have a small problem with the rand operator. at first i tried using it without srand but gave me the same value each time. i have inserted srand(time(0)); but my compiler throws me up these errors: 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C4430: missing type specifier - int assumed. Note: … |
|
Re:
in which language are definitions of built in functions like printf written...assembly or C? |
|
Re:
Hi, I'm doing 6Lowpan adaptation layer using c++. I would like to create an array of linked list - each element of array consists a linked list - each linked list links all fragments of same tag together according to their offset Is this correct? myarraytype* myarray[myarray_size] = mylinkedlist; Thanks. … |
|
Re:
[CODE] import java.io.*; import java.net.*; public class Server { ServerSocket ss; ObjectOutputStream oos; ObjectInputStream ois; public Server() { try { ss = new ServerSocket(8888); } catch(IOException e) { e.printStackTrace(); } } public void run() { String message; try { Socket sock = ss.accept(); System.out.println ("Connection received from " + sock.getInetAddress().getHostName()); … |
|
Re:
[B]I want to draw geometric diagram like straight line,triangle,circle etc using C language.I want some help for coding n algo....:)[/B] |
|
Re:
Hello I would to convert String number="((5+5)*6)/2" to integer because I get value from read file and keep in string Help me please. T_T |
|
Re:
Hi all, I am new in java. How can I sort a linked list on the basis of a particular string..? I have created a class with two elements, 1. Name 2. Address and I am reading these elements many times Now I want to sort this on the basis … |
|
Re:
first i am creating socket, with that socket descriptor i am sending some no. of bytes through sendto(....) function. At the time of receiving through recvfrom(....) function, my code was hanging if the specified destination address is not available. Suppose if destination is available the it's working correctly... Why this … |
|
Re:
I have made a program which the user will input the total inputted numbers and record it as an array, sort the biggest and smallest number, post the original inputted number, reverse the original's order, and lowest to high order. I have done the recording, sorting, however, when the program … |
|
Re:
spiral matrix for n*n order 1 2 3 4 12 13 14 5 11 16 15 6 10 9 8 7 . It is for printing a spiral matrix when n=5. It gave a correct output only for the elements on the sides. view sourceprint?01 class spiral_matrix 02 { 03 … |
|
Re:
Ok!!i have a 2d array..n i created a letterTray which is taking 7 letters from the letterbag which was already created..now in the JoptionPane in the String by giving 3 numbers..the 3 numbers will represent the row number, column number and the letter number..how do i do it??here is my … |
|
Re:
I have seen the following in a abook: "The argument(s) of a method can be any type of object (as long as its class has been made available to the program), as well as the predeļ¬ned default types of variable. For example, methods in our three-vector class are not limited … |
|
Re:
Hi everyone! Is there a way/command in C to find a string that is contained in a longer string? I'm currently developing a C program in Windows that sends requests to a machine and gets its response through socket programming. The response is an image in jpeg/jfif format. The whole … |
|
Re:
I'm creating a voting program in which you input the persons name and how many votes they have received. It than prints out the persons name, their amount of votes and the percentage of their votes from the total. I can't seem to get the percent of total to work … |
|
Re:
hi I want to write my C functions in 2 separate .c files and use my IDE (code blocks) to compile everything together. How do I set that up in code blocks? How do I call functions in one .c file from within the other file? |