Hi guys, I've been trying for over 3 hours just to know how to compare a char to a letter in a string. This is sure confusing, consider that I am a mechanical eng. student >.< Lets get straight to the point Problem 1: passing string and char to a function, and display it [CODE] #include <iostream> #include <string> using namespace std; void CountLetter(string a, char b) { cout << a << "\n"; cout << b << "\n"; } int main() { CountLetter("tttyuttt", 't'); return 0; } [/CODE] Problem 2: after I can pass the char and string to that …

Member Avatar
Member Avatar
+0 forum 3

Hi all, I've pulled most of my hair out over the last few days and need some help. Description: I am creating a db application with dreamweaver and using php and mysql server behaviour. My database consists of losts of many to many tables that are necessary. I have created the 1st page with a table and links that send an [U]url variable[/U] to the detail form on another page. That works fine. Problem: As per normal, I have recordset with an update form on the detail page that recieves the url variable. That all works great. However, I want …

Member Avatar
Member Avatar
+0 forum 6

Hi to all... I am getting a warning, i am trying to avoid that but its not sorted out..Please suggest me to avoid that warning. my code is as follows.. [CODE] const char var[][2][5]={ {"1.95","3.70"}, {"2.40","4.60"}, {"2.70","5.70"}, {"6.60","13.40"}, . . . . }; void fun(int col,int row,char *str) { ... ... //(here i am printing that string...) } main() { fun(var[45][1]); } [/CODE] My definition of fun function, array, main function are in the same file..... [QUOTE]main.c(11498): warning: passing arg 3 of `fun' discards qualifiers from pointer target type [/QUOTE] So this is the warning i am facing...please suggest me …

Member Avatar
Member Avatar
+0 forum 2

Hello Everyone, I have chosen to use Google Custom Search with my website and was given the following code, my question is, how can i pass a search query from my homepage which has a standard form on there to the search page which holds this code? I am given a search box within this code but would prefer to use my own on the homepage... Thanks [CODE] <div id="cse" style="width: 100%;">Loading</div> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('001427157132748787903:rmvstkwg_s4'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.draw('cse'); }, true); </script> <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /> <style …

Member Avatar
Member Avatar
+0 forum 3

Hey, it's me again. Again with a topic that has been covered here but reading through the old threads didnt help me to solve my problem. And I am pretty clueless at the moment. Consider the class passenger_queue with 2 functions, namely: [CODE]int passenger_queue::get_passengers_waiting() const { // Insert your code here. Use the iterator defined in this class. int sum = 0; } return sum; } [/CODE]and [CODE]std::vector<passenger*>& passenger_queue::passengers_at_floor(int floor_) { return _waiting_passengers[floor_]; }[/CODE] member variables are: [CODE] typedef std::map<int, std::vector<passenger*> > p_map; p_map _waiting_passengers; std::vector<passenger> _passengers;[/CODE] First of all the comment in the get_passengers_waiting. Apart from the constructor which …

Member Avatar
Member Avatar
+0 forum 11

so. . . i guess you could say i'm kinda new here but. . . this site really helps me alot this past few days and i decided to join... i was surfing all over the internet and i can't find what's the problem with my program. this always says i need to input something inside the "[]" but i'm passing it to a function bubble sort . .. . i can't explain it well . . . i tried using quicksort but the same problem occurs. . . . can someone help me? here's the code. [CODE]#include <cstdlib> #include …

Member Avatar
Member Avatar
+0 forum 5

In reference to this post [url]http://www.daniweb.com/forums/thread43763.html[/url] I have another more specific question about passing data between forms in VB.net I have a form with over 50 variables that I need to access on a second form and if i followed the method above, my form 2 will end up way too long and time consuming. I'm making a complex calculation software that prompts user inputs values and calculates all those unknown variables. I need to display all the resulting values in the 2nd form. and from the 2nd form , i want to give the users an option to export …

Member Avatar
Member Avatar
+0 forum 6

I am trying to define and pass through (I think that's the term) a variable from my login page to other parts of my site. Right now, the user logs in providing their username/password combination and those variables are able to be used. What I want is if a login is successful, to store other variables for the user, specifically [I]FName[/I] and [I]LName[/I] which are columns in the [I]User[/I] table. What would I need to change here? :confused: [CODE=php]<?php session_start(); // Start a new session require('dbconnection.php'); // Holds all of our database connection information // Get the data passed from …

Member Avatar
Member Avatar
+0 forum 4

Hi! I'm writing the mergesort algorithm, theoretically everything is fine in it but when the function gets to call itself the program crashes. I belive that I'm doing something worng when I pass the vector<int> as a parameter to the function. [B]procedure mergesort(T[1 .. n]) if n is small then insert(T) else arrays U[1 .. n div 2], V[1 .. (n+1) div 2] U <- T[1 .. n div 2] V <- T[1 + (n div 2) .. n] mergesort(U); mergesort(V) merge(T, U, V)[/B] [CODE] void mergeSort(vector<int>& mass){ if(mass.size() <= 16) sort(mass.begin(),mass.end()); else { vector<int> u,v; int size1,size2; size1 = …

Member Avatar
Member Avatar
+0 forum 3

Hi, I have a c# windows app with a formTab on one of the forms. What I'm trying to do is pass the id of one datasource into the parameter of the query for another datasource on another tab. So effectively when the row containing the id field is selected the data on the next tab can be queried using that id field as aparameter. So how do I pass that value? sorry - I hope that isnt too confusing! Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi there ! I have a tree view control and a button in Form1. The button takes me to Form2 which has a text box and a save button. What I'm trying to do is get the button on Form2 to add what i have typed in the textbox as a tree node in Form 1 I'm completely stumped and any advice / code snippets that could get me started on solving this problem would be greatly appreciated. Thanks !

Member Avatar
Member Avatar
+0 forum 3

[B]Specifications (minimum):[/B] The CDROM class contains the following, private, data members: string Name; // The Name of the CDROM string CDType; // The Type of CDROM float Cost; // The Cost of the CDROM [I]The ONLY recognized (i.e., legal) CDROM types are, “Game”, “Word”, “Compiler”, “Spreadsheet”, “Dbase”, and “Presentation” (AND, no others!).[/I] The CDROM class contains the following, public, member functions: [U]CDROM();[/U] // Constructor – hard-code initializes data members [U]void LoadInformation();[/U] // Prompt for, input, validate and set all data members [U]float ReturnCost();[/U] // Return the value in the Cost member data. [U]void DisplayInformation(); [/U] // Display to the screen …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to trap a user entry that cannot be found in the database. When a code is entered, the page should give a "Code Not Found" message if it is an undefined value. However, it didn't; and it always shows the "undefined" value to the page instead. I'm really new to PHP, Javascript and AJAX, and I would greatly appreciate if you could help me on this. Here's what I actually did: getting user input: [CODE]<input type="text" name="fscode" size = "4" maxlength = "4" onKeyPress="return checkEnter(event,this.name,document.fchartact.locode)">[/CODE] finding the code: [CODE]<?php switch ($_GET['action']){ case "find": if ($nrows == 1){ echo …

Member Avatar
Member Avatar
+0 forum 1

I have a csv file that has 12 columns. I've been using: [code=c++] while(!infile.eof()) { getline( infile, source, ',' ); outfile << source << ", "; getline( infile, native_ID, ',' ); outfile << native_ID << ", "; getline( infile, index, ',' ); outfile << index << ", "; getline( infile, charge, ',' ); outfile << charge << ", "; getline( infile, cluster_ID, ',' ); outfile << cluster_ID << ", "; getline( infile, fdr, ',' ); outfile << fdr << ", "; getline( infile, precursor_mass , ',' ); outfile << precursor_mass << ", "; getline( infile, calculated_Mass, ',' ); outfile << …

Member Avatar
Member Avatar
+0 forum 1

Basically, after the user inputs a cvs file which is formatted like (unmod.cvs that is attached is complete file): Source, Native ID, Index, Charge, Cluster ID, FDR, Precursor Mass, Calculated Mass, Mass Error, Peptide, Mods, Search Scores /tumor/set2/mam_082208o_individualsamples_747T_set2_082008_A01,scan=771,770,2,46,0,1162.436,1162.438,0.001953125,NDDDEEEAAR,,(mvh 52.0926)(mzFidelity 69.9226) /tumor/set2/mam_082208o_individualsamples_747T_set2_082008_A01,scan=1147,1146,2,93,0,1436.543,1436.506,-0.0369873,AAEDDEDDDVDTQ,,(mvh 68.8836)(mzFidelity 92.7468) *note that the mods value is a space, hence the double commas after the Peptide ("NDDDEEEAAR") I need all those values to be copied and outputted in another file. I used the getline() function to get the values, and everything is copied fine to the output file. The problem I'm having though, is that I need to …

Member Avatar
Member Avatar
+0 forum 1

Having trouble trying to copy the vector 'sel' in main to vector 'ask' in class A. Can someone either explain or show me? Thanks in Advance![code]class A{ private: public: vector<Trader> ask; void AskMatchList(vector<Trader>&); void showAuct(); }; void A::AskMatchList(vector<Trader> &list){ vector<Trader>::iterator it; f1= new Trader; //I understand this is the WRONG WAY f1->BidId; //but dont know the correct way.... :( f1->TraderId; f1->type; f1->quantity; f1->price; } void A::showAuct(){ vector<Trader>::iterator it; for(it=ask.begin();it!=ask.end();++it){ it->showTrader(); } } int main(){ srand ( time(NULL) ); vector<Trader> sel; vector<Trader> buy; vector<Trader>::iterator it; A auct; int x = 0; Trader* seller= new Trader[(NUMSELLER*NUMBIDS)]; Trader* buyer= new Trader[(NUMBUYER*NUMBIDS)]; //code to …

Member Avatar
Member Avatar
+0 forum 1

Hi all, I've looked through this forum for some hours and am absolutely unable to fix my problem; no matter what I do. I'm trying to pass a PHP variable as part of a MYSQL query like so: [CODE] $id = $_GET["bodyid"]; $blog = getEntries("SELECT `Articlebody` FROM `Blog` WHERE id ='$id'"); function getEntries($query) { $connection = mysql_open(); echo $query; $result = @ mysql_query($query, $connection) or showerror(); $blog = array(); while ($row = mysql_fetch_array($result)) { $blog[] = $row; } mysql_close($connection) or showerror(); return $blog; } [/CODE] What is happening is that the query is returning no results because the variable is …

Member Avatar
Member Avatar
+0 forum 4

Hi, I have an ajax script that sends a request to a servlet for information to be inserted into a table cell. The servlet then handles the request and replies with something like this: (I took the liberty of removing all the out.println tags) [CODE] <script language='javascript' src='whiteWine.js'></script> <table align='center' border='0'> <tr> <td align='center'> <img src='Images/Buttons/Small/left.png' id='leftButton' onclick='prevPicture()' onMouseOver="changeOver('leftButton')" onMouseOut="changeOut('leftButton')" > <img src='Images/Buttons/Small/right.png' id='rightButton' onclick='nextPicture()' onMouseOver="changeOver('rightButton')" onMouseOut="changeOut('rightButton')" > </td> </tr> <tr> <td colspan='2' align='center'> <img id='mainPicture' src='Images/Wines/White Wines/whiteWine01.png' /> </td> </tr> [/CODE] For some reason, however, all the scripts functions cannot be found on the page. If I attach the …

Member Avatar
Member Avatar
+0 forum 4

Hi All I've just been learning about events in delphi. I'm writing a program to communicate with a serial device that reads pressure data. Currently the program has been written with a separate thread to read the data, and when a complete data string is found, an event is called with the results. The current architecture is as below (excuse the drawing). [CODE] --------------------------- FmMainForm --------------------------- | | --------------------------- Unit_Pressure --------------------------- / \ / \ / \ ------------------- ------------------- Pressure Meter Logging Thread -------------------- --------------------- [/CODE] A copy of the pressure meter object is passed to the Logging Thead object …

Member Avatar
+0 forum 0

OK, so I have this project to do and cant figure it out. I am not positive on calling functions correctly and I am kind of lost when it comes to parameter passing. So my program needs to read a text file 1 integer at a time, find out if it is odd or even, add 1 to either odd_tally or even_tally, and then display the total # of even and odd integers. I am only getting 3 Warnings right now and it is for unitialized variables (in_val, odd_tally, even_tally) [code]#include <iostream> #include <fstream> using namespace std; void examine(int, int, …

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm trying to figure out how to pass parameters across JSP pages without using links. For some reason, I can only get null across... Here is my code: Page 1 [CODE] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Test Page</title> </head> <body> <form name="testForm" action="Test.jsp"> <select name='tableSelect' onChange='testForm.submit();' style="text-align:center"> <option value='--Select Table--'>--Select Table--</option> <option value='CONFIG_SOURCE'>CONFIG_SOURCE</option> <option value='CONFIG_PROCESS'>CONFIG_PROCESS</option> <option value='CONFIG_PROCESS_SOURCE'>CONFIG_PROCESS_SOURCE</option> <option value='CONFIG_SAL_ROUTING'>CONFIG_SAL_ROUTING</option> </select> </form> <% out.println(request.getParameter("tableSelect")); %> </body> </html> [/CODE] Page 2: [CODE] <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Test Recieve Page</title> </head> <body> <% out.println(request.getParameter("tableSelect")); %> </body> </html> [/CODE] Thanks, -Ashton

Member Avatar
Member Avatar
+0 forum 4

The End.