177 Topics
|
|
Hi, In below code snippet , can anyone let me know how to print the functor value output (3,4,5,6,7) without embedding add function in class. #include<iostream> #include<vector> #include<algorithm> using namespace std; void add ( int i) { i=i+2; } int main() { vector <int> vec ={1,2,3,4,5}; for_each(vec.begin(), vec.end(),add); for (auto … |
|
Hello everyone! I'm fairly new to C++ and I have hit a serious road block....I cannot for the life of me get my program to fill a structure from a file and print the array correctly. I don't know what to do :( It prints a series of numbers because … |
|
I have been working on this for awhile, but I was hoping to get input from someone with more experience. I have to stick with the structure and enum format for the assignment, but I was wondering if anyone had any opinions on the way the high/low temperature sections should … |
|
Hi , I need to implement efficient search algoritham for comma separated list of MSISDN's that needs to be loaded in memory (left side of '|') character. Followed by the comma separated series of MSISDN's that needs to be searched in the above huge list(millions)(right side of '|' character). Example: … |
|
Hello, I'm trying to write a program that takes an input file name and lists the folders in a heirarchy ex.Folder subfolder etc I have most of my code, but I'm getting 2 errors that are connected and I have no idea how to fix it. Here is my code: … |
|
#include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #define size 400 using namespace std; char infix[size],postfix[size],Stack[size]; int top; int precedence(char ch) { switch(ch) { case '^':return 5; case '/':return 4; case '*':return 4; case '+':return 3; case '-':return 3; default:return 0; } } char Pop() { char ret; if(top!=-1) { … |
|
|
hi i have problem , i want to modify a file without copy to another file so any one can give how to do it ? I tried following method to modify a given location or pointer in file but did not work . ofstream outfile; outfile.open ("test.txt"); outfile.seekp (3,ios::beg); … |
Basically - I'm looking for the best game structure. Here's the idea that I have # IDEA *Class* - **GUI** - Can be customised to contain buttons and to do specific things. This can simply have an event handler function that returns the index of which button was pressed. *Class* … |
|
Hi there, This question relates to data structures, performance and approach to a problem. It is best explained with example so bear with me. For the record, I will be using a combination of PHP, MySQL and Apache server on a dedicated Linux server. The problem is how we would … |
|
The game plots a bank robbery. Lots of people witness that robbery. Our game will load the lists of suspected offenders while the players (witnesses) will have to identify the offenders of this robbery. Game should load list of offenders to identify the one as quickly as possible. Admin can … |
|
I have the following file structure. Some files are dynamically added to a zip file and downloaded. uploads ----- 1 ---------- test.jpg ---------- another-test.jpg ----- 2 ---------- yetanotherfile.jpg ----- 3 ---------- evenmorefiles.jpg However, when I unzip the downloaded file it keeps that same structure (only with some files missing) and … |
|
Take the following C structure: typedef struct dataPoint { tick * tickData; struct dataPoint * previousDataPoint; struct dataPoint * nextDataPoint; } dataPoint; Compiling on a 64-bit system with 8-byte words, this structure takes up 24 bytes (3 words) of memory. 24 % 8 = 0 ... so it is word … |
|
# Need your help! - Masters thesis / research paper # ## Hi there, ## within the final stage of my masters thesis I need to conduct a survey concerning "Advertising Appeal for Corporate Websites". I would appreciate your participation in my online survey/questionnaire. The reason for this survey is … |
|
**how can i create a program that provides 3 types of data structures: linked list, stack and queue.which my program will provide a menu that a user can choose whether to use a linked list, stack or queue.** Example of output: Main Menu 1. Linked list 2. Stack 3. Queue … |
|
#include <stdio.h> typedef struct { int stat1, stat2, stat3; } X_type; void createPlayer(char *X) { X_type X; } int main() { createPlayer("Foo"); createPlayer("Bar"); return 0; } I would like to create a structure ojject based on a string passed to a function. So the above code would create 2 X_type … |
|
Can any one tell me about fibonacci heap? I have read that it can be implemented using prims algorithm. but i actual i do not know what is fibonacci heap So can any one tell me what is fibonacci heap? how to implement fibonacci heap? what are the applications of … |
|
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "queue.h" #include "stack.h" #define NAME_SIZE 20 #define RECORDS_SIZE 100 typedef struct { char studName[20]; int timeEnter; int timeUpdate; }STUDENT; typedef struct { char tutorName[NAME_SIZE]; int tutorTime; STUDENT *ptr; }TUTOR; QUEUE *queue1; STACK *stack1; void getData(STUDENT *studArr[], TUTOR tutorArr[1]); int main(void) { STUDENT *studArr[RECORDS_SIZE]; … |
|
why I am trying to dynamically allocate memory for this pointer to array of structure I have STUDENT *studArr[] where STUDENT is the name of the structure I tried to allocate like this #include <stdio.h> #include <stdlib.h> #include <string.h> #include "queue.h" #include "stack.h" #define NAME_SIZE 20 #define RECORDS_SIZE 100 typedef … |
|
In Assembly there's not going to be much insight on linked lists, B trees, arrays, etc. In fact those don't even exist at the bit level. Sure, they help solve some problems from all the way up to your compiled language syntax, but such symbols don't exist in machine code, … |
|
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 typedef struct { char *name; int score; }RECORD; float calMean(RECORD list[], int count); void sortData(RECORD list[], int count); int main (void) { // Declarations float mean; float median; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count … |
|
#include <stdio.h> #include <stdlib.h> #include <string.h> #define FILE_NAME 20 #define LIST_SIZE 50 float calMean(RECORD list[].score, int count); typedef struct { char *name; int score; }RECORD; int main (void) { // Declarations float mean; FILE *fp; char fileName[FILE_NAME]; RECORD list[LIST_SIZE]; char buffer[100]; int count = 0; int i; // Statements printf("Enter … |
|
I need this program to record bugs into a MYSQL database. I need to create the database if it is not found. I have my html set up. I am posting pictures below of what I have, and what functionality I need the program to have. I have the html … |
|
I got a java test done and somehow my answer for this question is incorrect, can you guys help me explain it? So the question is: in a binary tree with height 3 the least deep leaf has depth 2 (Root has depth 0). a)Max numbers of nodes this tree … |
|
I need help in this c program i need to have a delete function that will delete a specific string(or a line) in my FILE Is reading the string from the file and putting them in an array, okay? #include <stdio.h> #include <string.h> struct { char title[100]; char author[100]; char … |
|
Hi I'm working on the implementation of a boolean method to check if an expression has balanced parentheses using recursion. I cant figure out how to check if two elements of a given expression match i.e ( ). I was able to finish it without a problem using stacks, but … |
|
I need help trying to figure out how to insert into a multi linked list. I know how it works with a linked list with only one piece of data but not 2 pieces with 2 pointers. Essentially what I want to be able to do is creat a multi … |
|
This code is crashing, please tell me for what all I need to assign memory. Thanks #include<stdio.h> #include<conio.h> #include<stdlib.h> struct s1 { char *p1; }; struct s2 { struct s1 *p2; }; struct s3 { struct s2 *p3; }*p4=NULL; int main() { char a='a'; p4=malloc(sizeof(struct s3)); p4->p3->p2->p1=&a; printf("%c",*(p4->p3->p2->p1)); return 0; … |
|
|
So i have write the following code (above) and now for the second part i am required to apply the Complex Number into finding the voltage across the Resistor in a series RLC circuit. The following tasks : Create an executable program Resonant Circuit, which allows you to output the … |
hi people.. I was wondering if u experts could help me with this. I have attached a screenshot of my form. This is an invoice system.. I have customers table for customer profiles.. I have Products table I have manufactures table I want to save all invoices so that these … |
|
i need c++ code for simple linked list to implement algorith and data structure 1.create_node_and add to list 2.frst node delete 3.last node delete 4.delete node between first and last node 5. displaye the value of node in revese order 6. searching 7.exist |
The End.