15,552 Topics

Member Avatar for
Member Avatar for negru

Write a program that will print two closest pair integers in an array (if there are more than one pair with the same distance, then print all pairs). //Example: 6 -3 8 0 5 //The closest numbers: 5 6 -> difference is 1 In the following program I am using …

Member Avatar for rubberman
1
875
Member Avatar for ressenjack

Anyone have flowchart or algorithm of Snap Card game which can let me to refer since I need it for my assignment. It will be very helpful if provided me the source. Thank you

Member Avatar for Reverend Jim
0
190
Member Avatar for Darth Vader

Hello, I try to catch the HTML code from a webpage after I have logged in to a page. HTML is returned but that is the orignal HTML only BEFORE I logged in. For example I try to find "Log out" and other content in the string "getDocumentHTML" returned which …

Member Avatar for JOSheaIV
0
342
Member Avatar for ratonhnaketon

hello to everybody. i'm writing a knight tour program. in this code, you enter the dimension of the board and the frst place of the knight and then ask the user to what to do! n = next p = print (the other are not completed yet) here's the code …

Member Avatar for tinstaafl
0
372
Member Avatar for Evans_1

Am creating application and l need to fill a combo box list. However, l was able to do all and is working but whenever l filling the last combobox, l get an exception as below. First-chance exception at 0x7789dba9 in Unical PTUME.exe: 0xC0000005: Access violation reading location 0x00000001. Unhandled exception …

0
137
Member Avatar for negru

I don't understand how to debug the following code "on paper" (without a compiler): #include <stdio.h> #define SUB(T,x,y) {T x=y++; {T x=y++;}} int x; static int y; void f(int n) { if (n) { SUB(int,x,y) f(n-1); } } main() { extern int x,y; int i=0; for ( ; ++i<3; ) …

Member Avatar for negru
0
185
Member Avatar for Michael_48

I am having a hard time comparing my if else statements and getting it right. I want to ask for male or female, and if male then I can respond "Hello, Mr...." and if it is female then I can respond "Hello, Mrs...." #include <stdio.h> int main (void){ int firstNum; …

Member Avatar for David W
0
305
Member Avatar for Darth Vader

Hello, I use the webkitbrowser which is simular to the webbrowser. Now on a website, I want to programatically insert a string into a textBox. This I have succeeded to do like this: webKitBrowser1.Document.GetElementById("txtbox1").SetAttribute("value", "hello"); After this I will need to programatically click a button that will check that "hello" …

0
150
Member Avatar for negru

Write a program that will print adjacency matrix of a directed and weighted graph. Weights are positive real values, and graph is strongly connected. Then, print values of two vertices which indices are read (values of each vertice are functions: **sin(index),cos(index),index^2,sqrt(index)**). How to check if a graph is strongly connected? …

Member Avatar for rubberman
0
352
Member Avatar for ayeswarya

[CODE]struct PCB* handleProcessArrival_PP(struct PCB *processhead,struct PCB *processtail,struct PCB *currProcess,struct PCB *newProcess,int currTime){ if(currProcess==NULL){ newProcess->executionStartTime = currTime; newProcess->executionEndTime = currTime+newProcess->totalBurstTime; newProcess->remainingBurstTime = newProcess->totalBurstTime; if(newProcess->processID==processhead->processID){ processhead= newProcess->next; printf("processhead in case 1 %d \n",processhead->processID); } currProcess=newProcess; printf("***current process = new process%d \n",currProcess->processID); contents(processhead); return currProcess; //return processhead; } if (currProcess->processID !=0){ contents(processhead); if(currProcess->processPriority>newProcess->processPriority){//new …

Member Avatar for rubberman
-1
3K
Member Avatar for Gà_1

I'm writing a simple program to figure out how Linked List works, but for now I'm stucking. I don't know which line cause the error or I had a mistake in thinking. I run my program by my hand and it works fine. But when run, it gets error at …

Member Avatar for Beingmahendra
0
217
Member Avatar for sirlink99

Hello everyone, I am trying to write an object loader in c++. Currently, I have a file that is made up of many sub objects and I am having a little difficulty figuring out how to process the data. First of all, here is an example of part of the …

0
179
Member Avatar for negru

I need some explanation with the logic in the following program: Create a data structure such that it contains of three singly linked lists that are connected to one central node. **i-th** list can only have elements such that **list_element % 3 = i**. First element of every list represents …

Member Avatar for tinstaafl
0
348
Member Avatar for clife

Hi, I would like to learn dbus as i encounter it more in my daily work.The problem is that the applications already using it are very complex and there is very less scope to understand exact use of DBus communication. I know other IPCs like message queue, socket etc, the …

Member Avatar for rproffitt
0
181
Member Avatar for Sameer_6

I want to make a menu driven program in which I have 4 options 1) input() -Inputs the data WITH A UNIQUE KEY (AND CHECKS FOR REPETION) and writes it to a file 2)output() - Outputs the data using a UNIQUE KEY (WHICH WHEN NOT FOUND GIVES AN ERROR) 3)delete() …

Member Avatar for rubberman
0
306
Member Avatar for negru

Write a program that will read data about **n** movies (data about a movie is defined in structure). Sort data about movies (criteria of sorting is by title of a movie and by surname and name of an actor). Read data about one actor, and print data about all movies …

Member Avatar for David W
0
234
Member Avatar for negru

Write a program that reads **n** strings (with blank spaces). For each read string, check if it is a permutation of some other read string. If it is, print the found string and all other found strings that are permutations of the found string. Uppercase and lowercase letter are not …

Member Avatar for David W
0
282
Member Avatar for BobFX

Hi, I have an app that works with Visual Studio 2010, but not with VS2015. Its purpose is to redirect stdout to a thread that reads from a pipe created with: if (FALSE == CreatePipe(&pipeout, &pipein, &sec, 0)) { mes = strdupa("SCRIPT: Unable to create pipe"); goto err; } SetStdHandle(STD_OUTPUT_HANDLE, …

Member Avatar for BobFX
0
555
Member Avatar for negru

Write a program that reads an array of **n** polynomials and prints their squares using arrays. Example input: n=1 1. polynomial: order: 2 coefficients: 1 1 1 Output: square(x^2+x+1)=2x^3+4x^2+2x+1 The following code gives **SIGSEGV** segmentation fault: #include <stdio.h> #include <stdlib.h> #define MAX_ORDER 10 typedef struct term { int coef; int …

Member Avatar for rproffitt
0
161
Member Avatar for negru

I am having problems to figure out how to do arithmetic operations on positive integers represented as strings (addition, subtraction, multiplication, incrementing and decrementing). I did the addition as following: #include<stdio.h> #define MAX 100000 typedef struct { int arr[MAX]; }NUMBER; void read(NUMBER *add_num) { int i,digit=0; char ch[101]; scanf("%s",ch); while(ch[digit]) …

Member Avatar for David W
0
2K
Member Avatar for negru

I need help with the following program: Define a structure **VEHICLE** which contains **producer, model and chassis number**. Store the content of a structure in binary search tree such that the **key** for storing contains all fields of a structure (**producer** has the highest priority, and **chassis number** has the …

Member Avatar for tinstaafl
0
240
Member Avatar for Sameer_6

Please Help me out!! After many tries I'm unable to return a string from a function. Please reply with the corrected code! I want it for my High School. Thanks in advance! I've shortened the code here. #include<iostream> #include<iomanip> #include<conio.h> #include<cstdlib> #include<fstream> #include<string.h> #include<stdio.h> using namespace std; string logdisplay(int log) …

Member Avatar for Suzie999
0
271
Member Avatar for logicslab

Dear Friends, I am a newbie in GTK3 development using C. I created a file menu with some sample menu options. But I need to activate each menu using keyboard shortcut. Please provide a sample code based on the given working code . #include <gtk/gtk.h> static void open_activated(GtkWidget *f) { …

0
188
Member Avatar for Sameer_6

Please help me to use the functions. The program does not move ahead of main() to use the functions. I mean once the main() statements are executed the program doesn't execute the calling of functions. I've used Turbo C++ which does not allow string instead of char data type(Though I've …

Member Avatar for rubberman
0
253
Member Avatar for Sameer_6

**Please fix the errors in the code ! I've used Turbo C++. I need it for my High School Project ** #include<iostream.h> #include<iomanip.h> #include<conio.h> #include<process.h> #include<fstream.h> #include<string.h> #include<stdio.h> //logistics //site fees //transaction fee //packaging fee //FK //SD //AZ //PayTM //eBay //ShopClues char categdisplay(); char logdisplay(); char wbdisplay(); void display(); char …

Member Avatar for rubberman
0
408
Member Avatar for negru

The following program should create singly cyclic linked list which has **n** nodes, where data are random generated numbers from **0-99**. Create binary search tree which will contain all prime numbers from the list. Print binary tree in text file so that numbers are sorted in descending order and every …

Member Avatar for rubberman
0
405
Member Avatar for pavankumar77
Member Avatar for negru

The following program compiles successfully but doesn't give the output: Write a program that reads data about **n** number of **books**. Sort data about books lexicographically by **title** (if the title is the same, sort by **publish year**), and then for every book sort data about **authors**. Then, read **name** …

Member Avatar for rubberman
0
228
Member Avatar for negru

I need help with the following program: Create a structure **STRING** which represents a string ( as singly linked list). Check if the string is a palindrome using stack and function which prototype is **int palindrome(STRING *str);** Code: #include <stdio.h> #include <stdlib.h> typedef struct { char *info; }STRING; typedef struct …

Member Avatar for rubberman
0
1K
Member Avatar for anirbanengg

I am trying to return a pointer from a function and use the return in a different function . But I am getting memory leak. Please help. The test code which I wrote and detected with memory leak by CPPCheck. ######################################################################## # include < stdio.h > # include < malloc.h …

Member Avatar for anirbanengg
0
150

The End.