Hello there. I recently have been teaching myself C++ and have come across something that I just can't seem to grasp. I undersatdn the basics of structures but when it comes to this nesting type situation I just can't figure out what is going on. If someone could explain in a somewhat simple manner it would help me greatly Here's the code: #include <iostream> using namespace std; struct sct { int t[2]; }; struct str { sct t[2]; }; int main(void) { str t[2] = { {0, 2, 4, 6}, {1, 3, 5, 7} }; cout << t[1].t[0].t[1] << t[0].t[1].t[0]; …

Member Avatar
Member Avatar
+0 forum 2

I need help with my homework. Out professor doesn't explain anything and i'm struggeling. TMy homework is: Write, test and debug a program which asks the user to enter three floating point numbers and then reports the largest and the smallest of these values. Here is the example program dialog: Enter the first number: 43.5 Enter the second number: 110.2 Enter the third number 35 The smallest of the values is: 35 The largest of the values is: 110.2 When your program is working correctly, run it four times, using these value sets for the input: 20.5, 14.3, and 90.9 …

Member Avatar
Member Avatar
+0 forum 4

Hi everyone, I consider myself as a java beginner because I haven't been involved in a lot of projects. I'm opening this thread to raise awareness that we don't have java projects thread primarily for beginners and it could help advanced java programmers in terms of practising their java knowledge. I would like any operators in this forum to consider this idea. I am sure it will help people who haven't practisied what they have learnt. Any users likes the sound of the idea and wants to see it in this forum, please have your say here. Therefore, operators can …

Member Avatar
Member Avatar
+4 forum 30

Hello Everyone, I understand this is a basic problem, with a simple solution, but I cannot find a way to fix it. I'm trying to add a Jpanel to a JFrame and when I do the following. g.drawString("HELLO", 500, 0); The string is not seen on screen now if I do g.drawString("HELLO", 500, 5); This can be half-seen at the top, and perfectly if I make the y position 10 pixels. So I guess it has an offset of 10pixels (I don't know if this is the right word). The Frame class its... package Graphics; import java.awt.BorderLayout; import java.awt.Dimension; import …

Member Avatar
Member Avatar
+0 forum 2

Hi, I came across one question from codechef. [Click Here](http://www.codechef.com/problems/J7) Here, we are given P and S. Let l, b, h be the length, breadth, height of the box. we have these two inequalities 4*(l+b+h) <= P 2*(l*b+b*h+h*l) <= S We have to maximise the volume which is l*b*h. We are also given that test cases will produce optimal solution. Can any 1 please help me with it?

Member Avatar
Member Avatar
+0 forum 3

#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int compare(const void * a, const void * b) { return strcmp(a, b); } struct node { char name[51]; int index; }; /* 1.Sort the Array cities (which was copy of A) and Array B2 (which was copy of B). 2.Do binary search in sorted array B (called B2) to find a city in A which is not present in B2. 3.If the index found is i, then print "A[i] B[i] cost[i]$". 4.Do this for n - 2 times : For each B[indx], find it in sorted array cities and use its …

Member Avatar
Member Avatar
+0 forum 3

I'm looking for a simple database-server maintenance and management software. It need not to be free but it must be known in the field of networking.

Member Avatar
Member Avatar
+0 forum 3

What is the quick and easy way to update a navigation bar on a multipage website. I want the page to show where you are as well, currenly I am using a css id to keep track of what page you are on. <div class="nav"> <ul> <li id="current"><a href="some_url/">Home</a></li> <!-- CSS will display this link differently--> <li><a href="some_url">Somewhere else</a></li> <li><a href="some_url">Somewhere else2</a></li> <li><a href="some_url"">Somewhere else3</a></li> </ul> </div> That is the example I would use to show the current page with a css selector. I am familiar with SSI, but how can you maintain a different style for the link that …

Member Avatar
Member Avatar
+0 forum 3

Hello Daniweb users. I am a security analyst who needs to currently audit the compliance rate of machines for my client. He is having both Windows and Linux machines including AIX. I want to know rather than doing a manual check i.e. document to document, is there any tool (preferablly open source or free tool) which I can use to conduct this check. The reason being that the client is having more than 20 machines to be checked and it will take a long time to audit all of it. Hope anyone can share their experience in compliance checking or …

Member Avatar
Member Avatar
+0 forum 2

What we are to do is pretty much mentioned in the comments of the code. I have to make a class ARRAY, which searches a list etc... Right now I can't compile this and I'm so stuck. Please help :) Array.h [CODE] // Put comments about the class here. #ifndef ARRAY_H #define ARRAY_H #include <iostream> using namespace std; template <class T> class Array { public: static const int NOT_FOUND = -1; static const int DEFAULT_SIZE = 100; Array(int size = DEFAULT_SIZE); // Constructor // Creates an array of the size specified by the parameter size. The default array size is …

Member Avatar
Member Avatar
+0 forum 4

[CODE]public class Grades{ public int scoreTotal; public int numScores; double average; static String file = "randomNumbers.txt"; int lowest; int x; int temp; public static void main(String[] args) throws FileNotFoundException{ int scoreTotal = 0; int numScores = 0; double average = 0; int lowest = -1; int temp = 0; Scanner optScan = new Scanner(System.in); System.out.println("Do you want to drop your lowest score? Enter true or false."); boolean isDropped = optScan.nextBoolean(); Scanner scan = new Scanner(file); while(scan.hasNextInt()){ temp = scan.nextInt(); scoreTotal += temp; if(lowest>temp) { lowest = temp; } if(isDropped==true){ average = (scoreTotal-lowest)/(numScores-1); } else if(isDropped==false){ average = (scoreTotal/numScores); } } …

Member Avatar
Member Avatar
+0 forum 1

[CODE] <?php echo date("Y/m/d") . "<br />"; echo date("Y.m.d") . "<br />"; echo date("Y:->m:->d")."<br>"; echo("hello") ."<br/>"; $app5=5; echo($app5); $baby="going"; echo("$baby i love to "); //echo ($baby$app5); if($app5==5) echo "dance"."<br>"; echo strlen("dance"); echo strpos("dance","h"); switch($ab=1) { case 1: echo 1; case 2: echo 2; default : echo "default"; } $a = array(1,2,5,3,6); for($i=0;$i<5;$i++) echo $a[$i]."<br>"; $a = array(1=>"apple",2=>"boy",3=>"girl",4=>"koel",5=>"good"); for($i=1;$i<=5;$i++) echo $a[$i]."<br>"; echo $a[2]."<br>"; echo $a['2']."<br>"; $a=array ( $0=array(40,60,20), $1=array(278,102,173) ); for($i=0;$i<2;$i++) { echo "<br>".$a[$i]; for($j=0;$j<3;$j++) echo $a[$i][$j]." "; } ?> [/CODE] I have started learning PHP today and I was trying out some very basic commands. I am getting an error …

Member Avatar
Member Avatar
+0 forum 1

You can use and assemble with MASM611 very easily in Notepad++. Ihave find a very nice customization of Notepad++ on a blog. You can find it at [URL="http://easymasm.blogspot.com/"]http://easymasm.blogspot.com/[/URL]

Member Avatar
Member Avatar
+0 forum 2

public class First { public static void main(String[] args) { int a; a=EasyIn.getInt(); System.out.println(" the value of a " +a); }} // this code is showing an error of " easy In " not finding symble. // help me

Member Avatar
Member Avatar
+0 forum 4

Can you guys give a code or something. Any simple graphics would do. i have initiated my graphics.h I've tried using the codes i found online but they give me errors. LINKER errors. Please help me. Thank you!

Member Avatar
+0 forum 0

[B]Problem[/B]: (The Person, Sruden, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define the status as a constant. An employee has an office, salary, date hired. Define a class named MyDate that contains the fields year, month, and day. A faculty member has office hours and a rank. A staff member has a title. Overridde the toString method in each class …

Member Avatar
Member Avatar
+0 forum 3

Ok I am a programming student and need help with a problem, I already have most of it (so I don't need you guys to do my hw :P) but I am having problems with am, and I am not even sure if I am doing it right. [B]Problem:[/B] (The Person, Sruden, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or senior). Define …

Member Avatar
Member Avatar
+0 forum 6

Imagine my surprise when I logged onto Daniweb and saw a scrolling advert for IBMs Informix database. I've been using Informix for years and it is an incredibly elegant bit of code, and the object extensions you can use are totally unique. I'd always thought of Informix as a secret cult that those of us " in the know" used as a secret weapon to do databasey things the other developers cant :-) , looks like IBM are advertising it now so my competitive advantage is not going to last long :-( Anyone else out there experienced Informix ? Wanna …

Member Avatar
Member Avatar
+0 forum 11

Here is my script for defining the position in C# (with XNA) [CODE] public void PositionDefinierer(int v) { positionCheck = true; if (v == 1) { v *= 0; positionCheck = false; } else { if (v < 11) { v *= 50; } else { if (v < 21) { position.Y += 50; v -= 10; v *= 50; } else { if (v < 31) { position.Y += 100; v -= 20; v *= 50; } else { if (v < 41) { position.Y += 150; v -= 30; v *= 50; } else { if (v < …

Member Avatar
Member Avatar
+0 forum 3

I know there is a lot of threads already on this website, but I cant find any that remotely looks like it'd be help to me. I am getting frustrated over this bit of code error. Any help would be appreciated. php line 64 [CODE] $emails = $_REQUEST['email']; $data = mysql_query("SELECT current_image, email FROM employees where email='$emails'") or die(mysql_error()); //Puts it into an array while($info = mysql_fetch_array( $data )) { //Outputs the image and other data [/CODE] Notice: Undefined index: email in /var/www/vhosts/numyspace.co.uk/web_users/home/~unn_u020672/public_html/assignment/user/members.php on line 64 I am asking it to take email and current image from my database, trying …

Member Avatar
Member Avatar
+0 forum 5

Hi, I'd like to learn some basic graphics (2D) that would be easy to use and quick (So no OpenGL, or Direct X). Also, it NEEDs to have Linux portability. I've already tried Allegro and paintlib, neither of them could I install and they didn't look quite as easy as I wanted (though that'd be fine if there's nothing easier) jt

Member Avatar
Member Avatar
+0 forum 8

Create a program that will accept a date in numbers and output the date in long format. Have your program trap for the leap year and also invalid inputs. Your program will also ask if the user wants to input again. Range for year (1980-present) plsss help me ASAP...tnx!!!

Member Avatar
Member Avatar
-1 forum 1

Hi All! I'm new to this forum and new in the field of software development as well. Anyway, let get to the point. Following is the scenario in which I badly need help: Its basically a printing press software which will have all the job details (Only details) that have done or have to be done for the specific company say "Lipton". So, there might be a complete job information stored and whenever I need to see all the job details, this software should help me. I want to make an application or u can say software whose features will …

Member Avatar
Member Avatar
+0 forum 3

Hey Guys! I am vedel and this is my first Thread in this Community. My question is, how i can boot a c++ code? example code: [CODE] #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } [/CODE]

Member Avatar
Member Avatar
+0 forum 9

I need the coding for the following question in C: Read from a file (.txt file) and count the number of times the word "a", "is", "the", "and", "that", and "this" occurs.

Member Avatar
Member Avatar
-3 forum 3

The End.