Hi All, I below code snippet I have been using diff-2 structure with same variable due to having different -2 default values for the variable (var) in current implementation for both the structure a and b. This way i need to create 17 structure with same variable (var) but different default values. Could you let me know what is the best way to achieve the same with having same sturcture with different-2 values. Apart from this it is very much required to initialize the varaible (var) with default value in structure as it shouldn't be uninitialized. #include <iostream> using namespace …

Member Avatar
Member Avatar
+0 forum 5

Hi guys. Well according to the research I had, and MP3 file structure is as follows: ` AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM ` which is refered to as frames, and each. Each letter is one bit. I've seen samples demonstrating how to get data from this but what I want is to get/access letter "H" in the above frames. Anyone knows how I can go about doing that? Here are the samples of getting information of the file. [VbCity](http://vbcity.com/forums/p/147802/716236.aspx), [Codeproject](http://www.codeproject.com/Articles/5590/Reading-and-writing-MP3-ID3v1-tags), [Info about MP3 structure.](http://www.multiweb.cz/twoinches/mp3inside.htm#FrameHeaderH)

Member Avatar
Member Avatar
+0 forum 47

Hello everyone i really need some help about my website structure.. i have almost the full website but the structure is too bad and i cannot continue working... is there some good man/women to help me about it ?

Member Avatar
Member Avatar
+0 forum 15

A little experiment with custom sorting the result of a word frequency count using Google's Go language.

Member Avatar
Member Avatar
+2 forum 2

Hey guys im having a problem in structures.. i dont know how to initialize a an array of 10 contact instances.. plz help me out. this is my question statement.. "Declare a structure Contact that has a name, address, mobile number. Now create and (hardcoded) initialize an array of 10 contact instances. Prompt the user to enter the starting letters of the name to be searched. Your program must now print the details of only those contacts whose name start with the letters specified by the user. E.g. if the user enters Sa (independent of case) then your program will …

Member Avatar
Member Avatar
+0 forum 5

I have some doubts concerning some basic C++ concepts, and would be very thankful, if someone would kindly clear the doubts: a) Every variable of a data type occupies a specific amount of memory, like int occupies 2 bytes and so on. So, if I declare a reference variable as, [CODE]int &y = int x;[/CODE] How much memory does the reference variable occupy? b) Suppose I have a structure named "person", like: [CODE]struct person { //Data members... }[/CODE] and I also have a class named "person", in the same program, like: [CODE]class person { //Class members }[/CODE] and then if …

Member Avatar
Member Avatar
+0 forum 17

Hi guys, I want to access the element of structure from structure pointer using indexing for below code snippet. apart from this I also would like to know is there any way to find the type of member variable of structure on run time. #include <stdio.h> #include <assert.h> #include <stdlib.h> #include <string.h> #include<stdint.h> typedef struct Node{ uint32_t var1; uint16_t var2; uint32_t var3; uint8_t *var4; uint8_t var5[257]; }node_t; void initialize_field(node_t *field_val ) { field_val = (node_t*)malloc(sizeof(node_t)); assert(field_val != NULL); field_val->var1=0x22; field_val->var2= 2023; field_val->var3 =8132014; strcpy(field_val->var4,"RRAA:1001"); strcpy(field_val->var5,"ABC"); } int main() { node_t *field_val=NULL; initialize_field(field_val); //field_val[index] doesn't seems to be possible return 1; …

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, Any body knows what is the efficient way to create the map (key,value pair ) using linklist using c .Apart from this in this map one key can have multiple values and i need to display those values. I don't want implementation in c++. example string1->"james" string1->"mike" string1->"harry";

Member Avatar
Member Avatar
+0 forum 5

Hi! I was doing my exercise of C Language. In the exercise I was encountered by a question in which author says you to perdict the correct answer; I was uable to perdict it, so I compiled it to get the answer, the source code is this: #include <stdio.h> int main () { struct { int x, y; }s[] = {10, 20, 15, 25, 8, 75, 6, 2}; int *i; i = s; printf("%d", s[i[7]].x); return 0; } It yields this output: 8 I'm unable to understand why the answer is 8 whereas in my thinking it should be 15. …

Member Avatar
Member Avatar
+0 forum 2

Guys, In below code after reading string values from vector , I can have output like("VarID","flag","count") for(int i=0; i < v.size(); i++){ cout<<v[i]<<endl; } All are (varID,flag and count)are string literal , now i need to populate the structre with this string literal. where VarID = int,flag=bool, count=Int. Can anybody suggest regarding this how this converson will take place as i am new to STL.

Member Avatar
Member Avatar
+0 forum 5

Say I have this definition: #define SIZE 2000 typedef enum { TRUE, FALSE }Boolean; typedef struct{ char jobTitle[30]; char jobDesc[255]; char jobLoc[255]; float salaryMin; float salaryMax; Boolean isAvailable; }jobInfo; typedef struct cursorNode{ jobInfo jobRec; int next; }HeapSpace[SIZE]; typedef struct hnode{ HeapSpace heap; int Avail; }*VHeap; typedef int List; typedef struct{ List availJob; List notAvailJob }dualList; Let's say my function data type would be this: dualList ConvertOld2NewList(VHeap *VH, List *L) { return L; /*not sure about this since I will be converting this single list to a dual list*/ } I was asked to write the code of function ConvertOld2NewList. Given …

Member Avatar
+0 forum 0

hey guys, so im creating a page using php html js etc and what i wanna do is have two tables on that page. the first table is populated by data from database(easy) the second table is tricky for me. in the second table i want to be able to add rows but as a tree structure. for example button "add row" adds a new row in the table but at the same time it can be viewed as a tree structure(like it has that small arrow at the side) because i want to add functions like add subject(child) to …

Member Avatar
+0 forum 0

please give me a code of multiple linked queue in data structure using c++

Member Avatar
Member Avatar
+0 forum 9

Hi, I created a structure Vector and implement some functions to make the new defined type (vector) dynamically allocated and resized (inspired from the C++ implementation of the dynamic arrays : vector). I need to assign a structure to every vector element but I am not sure that I am doing it right: here is the structure that I ve defined: ************************************************** ********** typedef struct { void** mem; // to make this parametrizable I want the void* to point to a Structure (referenced with * a pointer) unsigned long elems; unsigned long elemsize; //element size unsigned long capelems; //capacity of …

Member Avatar
Member Avatar
+0 forum 6

I am trying to understand the structure of .class file in Java. Wrote a very simple program : package javautilities; public class Class_File_Structure { public static void main(String[] args) { int a = 10; int b = 20; int c = a + b; } } used the command javap -verbose Class_File_Structure.class and the results are : /* Classfile /C:.../Class_File_Structure.class Last modified 31 mar 2014; size 499 bytes MD5 checksum 25f2237144af07e2832d78f4b16e015a Compiled from "Class_File_Structure.java" public class javautilities.Class_File_Structure SourceFile: "Class_File_Structure.java" minor version: 0 major version: 51 flags: ACC_PUBLIC, ACC_SUPER Constant pool: #1 = Methodref #3.#21 // java/lang/Object."<init>":()V #2 = Class #22 …

Member Avatar
Member Avatar
+0 forum 3

My programm wont let me input all the data I need. And when I try to display them it won't even use the data that I could input. Please help me and sorry for my bad English it is not my native language, that's why all the data is in Slovene. Thanks for any help that I will get. #include <stdio.h> #include <stdlib.h> #include <string.h> struct student char vpisna_st[8]; char ime[20]; char priimek[20]; int starost; }stud; int main() { struct student stud; printf("Vnesite vase podatke. \n"); printf("Vpisna stevilka: "); scanf("%c",&stud.vpisna_st); printf("Ime: "); scanf("%c",&stud.ime); printf("Priimek: "); scanf("%c",&stud.priimek); printf("Starost: "); scanf("%d",&stud.starost); printf("Student …

Member Avatar
Member Avatar
+0 forum 2

So we were asked to reproduce the function generator and oscilloscope as a virtual instrument for our final exam. But I'd like to focus on the function generator. The audio generator GW Instek GAG-809/810 has only a single button for the waveform wherein the user would just press it repeatedly to show the desired waveform (i.e., sine wave, square wave). Yeap, the audio generator only have the two waveform but our professor wanted us to add the generator's feature, that is, for the users to be able to display the wave into sawtooth and triangle wave. So how do we …

Member Avatar
Member Avatar
+0 forum 1

hi dear fellow i have tried to add structure array in my program and i had a few issue to add. please can anyone tell me how can i add a structure array in the following program #include <stdio.h> #include <stdlib.h> #include<string.h> #include<conio.h> struct books{ char name[22], book[25],date1[10], date2[10],id[7],bid[7]; } el; void data(); int main(void) { void transaction(),modify(),view(),search(),delet(); int num; do { system("cls"); printf("\n\t\t***************************************"); printf("\n\t\t\t\t\t\t\t\t\t\t\t\t\t Welcome To BOOK MENU "); printf("\n\t\t***************************************\n"); printf("\t\t1. Append Record and Book"); printf("\n\t\t2. Modify record"); printf("\n\t\t3. Search Book"); printf("\n\t\t4. Delete Record"); printf("\n\t\t5. Dispaly All"); printf("\n\t\t6. Exit"); printf("\n\t\t***************************************"); printf("\n\t\t Choice:"); scanf("%d", &num); switch(num) { case 1: transaction(); …

Member Avatar
Member Avatar
+0 forum 8

Hello all, I'm trying to build a system to provide an easy access but very clever service select (sounds confusing, I will explain). Essentially I'm trying to create a system then will firstly store devices of different types, these types are: - Device type (iPhone, iPod, iPad) - Generation (4th Gen, 5th Gen etc.) - Model (iPhone 4s, iPod Touch , iPad 2 etc) In addition to this I also need to give optional parameters for instance "colour" or "memory" and then options "black" or "16GB" etc. and as I said these must be optional, for instance an iPhone 3G …

Member Avatar
Member Avatar
+0 forum 4

Hi, How do you stop divs from moving all over the place when you zoom in and out of browsers? The website I am going to create has to be centered in the middle of the webpage. I need to create a header with an animated gif in the left corner, text then a logo, then text link and another image on the right side. I need to create a nav bar which does not move about when resizing the browser with 8 tabs, with the last 3 being drop down lists. I then need a left sidebar, main content …

Member Avatar
Member Avatar
+0 forum 6

I am unable to convert my C file to mex file. Here is the C file I wrote to read in a tab-delimited file. The C program in running, but I am not able to successfully convert it to a mex file. I have also pasted the mex file I tried. Can anyone please tell me where is it that I am going wrong? I think I am making a mistake in declaring the structure. Also after declaring the output structure plhs[0], how do I retrieve it in MATLAB with desired structure elem? C CODE: #include <stdio.h> #include<string.h> #include<stdlib.h> #define …

Member Avatar
Member Avatar
+0 forum 1

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 i:vec) { cout<<i; } return 1; }

Member Avatar
Member Avatar
+0 forum 10

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 for some reason it's not taking the data from the text file. Here's the data I'm using: Goofy dog 8 Minnie mouse 22 Daisy duck 18 Mickey mouse 25 Pluto dog 10 Donald duck 21 Here's my code so far: (there's some additional values that will be used later in …

Member Avatar
Member Avatar
+0 forum 2

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 be done? Thanks for your help, I appreciate any hints. #include <iostream> #include <string> #include <iomanip> using namespace std; struct WeatherInfo { double rainfall; double highTemp; double lowTemp; }; enum Month {January, February, March, April, May, June, July, August, September, October, November, December}; int main() { const int MONTHS = …

Member Avatar
Member Avatar
+0 forum 1

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: 9845012345, 9845054321, 9845011111|9845011110, +919845012345, 09845054321 I want to implement this in c++ . Can anybody suggest what algoritham wiil be best suited for the same as here searched MSISDN can be expected in millions. I appreaciate your suggestions.

Member Avatar
Member Avatar
+0 forum 3

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: import java.util.Scanner; import java.io.File; public class TreeStructure { public static void main(String[] args) { if(0 < args.length) { String folderName = args[0]; File folder = new File(folderName); } Scanner input = new Scanner(System.in); System.out.println("Enter a folder name"); System.out.flush(); String folderName = input.nextLine(); File folder = new File(folderName); treeTraversal(folder, folderName); } …

Member Avatar
Member Avatar
+0 forum 1

#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) { ret=Stack[top]; top--; return ret; } else return '#'; } char Topelem() { char ch; if(top!=-1) ch=Stack[top]; else ch='#'; return ch; } char Push(char ch) { if(top!=size-1) { top++; Stack[top]=ch; } } int braces(char* s) { int l,r; l=0;r=0; for(int i=0;s[i];i++) { if(s[i]='(') l++; if(s[i]=')') r++; } if(l==r) return 0; else …

Member Avatar
Member Avatar
+0 forum 5

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); outfile<<5; outfile.seekp (12,ios::beg); outfile<<9;

Member Avatar
Member Avatar
+0 forum 7

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* - **Game Section**(s) *[Must be inherited]* - This should be used theoretically for each part of the game that has a different menu. For example one for title screen, for normal exploring, one for the shop, etc. Each would contain maybe a few GUI's and and all the functions specific …

Member Avatar
Member Avatar
+0 forum 2

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 model the world within a database and use our data structure to efficiently execute queries on this world structure. For instance, take a chunk of the USA part of our model of the world: The world - North America - - USA - - - California - - - - …

Member Avatar
Member Avatar
+0 forum 9

The End.