569 Posted Topics
Hello, In my class I have a method that basically does this: - Reads in characters from text file (as a string) - Converts the characters into an integer - Stores the values into the integer Here is the code: [code] bool Loader::Read(string theFile) { strRepositry = theFile; string theData … | |
Hello I'm working on a project, and I have the following classes: [LIST] [*]Loader - This loads the contents of the text file [*]Matrix - This processes the data that has been loaded [/LIST] Now I'm using association, Loader -> Matrix In my matrix class I have a method that … | |
Hello :) (Too many questions about this)! Basically, I'm trying to display the contents of a matrix without using "cout" in my class. (It's a bad method) I've tried to return an array, but, that failed miserably.. So I've got a method in my class: [code] double Matrix::read(int theRow, int … | |
Hello, basically I want to return an array from a function (So I don't output things in the class - just main) But I seem to get the error: "invalid types 'int[int]' for array subscript" Here is the code: [code] #include <iostream> using namespace std; int matrix() { int matrix[10] … | |
Hello.. I'm doing a project that involves searching/matching 2 matrix's. The basic idea: Matrix 1: 0 1 0 1 0 1 0 1 0 1 1 1 1 0 1 Which will then be interpreted in memory as: 0 1 0 1 0 1 0 1 0 1 1 1 … | |
Re: It basically works on the variable types (int, string etc..) So when using === it basically checks to see if the types are the same.. Let me show you with an example: [code] <?php $number = (int) 1; $number2 = (string) "1"; if($number == $number2) { echo '== Match'; }else{ … | |
Hello, I'm just wondering really.. I have a 2D matrix but I've defined it as a 1D matrix. So for example: [code] double *matrix = new double[N*M]; [/code] My question is, I'm going to be manipulating data very shortly and want to read this data in from a text file.. … | |
Re: That's because you need to do something else (I'm pretty sure).. For example, the code that you have WILL remove .php from the url's ([url]www.abc.com/article.php[/url] -> /article) but, because you are requesting variables (using $_GET) you need to provide something else. The .htaccess works by taking the url: /article/1/2 and … | |
Hello hope that you can help. Basically, I'm making a site that uses a header file and then for each page, include the header and set the title.. It's easy using procedural PHP but I want to do it using OO. Here is the problem: Page.php (class) <?php class Page … | |
Re: I don't get the memory location (I think that's what you mean)! But: [code] #include <iostream> using namespace std; double array_of_5[5] = {1,2,3,4,5}; double sum(double a , double b ); double a= array_of_5[2]; double b= array_of_5[2]; int main () { cout<<"The sum of two members of the array is: " … | |
Hello could someone explain what I'm doing wrong to get the error: Segmentation fault: 11 when trying to fill in a 2D array from two for loops? Here is the code: Matrix.h [code] #ifndef _Matrix_h #define _Matrix_h using namespace std; class Matrix { public: Matrix(); // Constructor Matrix(int M, int … | |
Re: Think you'll find it uses both jQuery (Javascript) / PHP.. There isn't an actual way to do it in pure PHP. | |
Hello I'm just wondering (In terms of computer science) If someone gave you a task about matrix, 2D arrays to: Assign to each of the a[I]i[/I][I]j[/I], the value 1000 + i + j? Would you assume that the array would have: rows = 500 columns = 500 That's the 1000 … | |
Hello, I'm trying to create a matrix that dynamically defines the rows and columns.. Now, everything is fine, apart from when I include a function to output the 2D array.. The error: Matrix.cpp:20: error: invalid types ‘double[int]’ for array subscript ... The code is: Matrix.cpp [code] #include <iostream> #include "Matrix.h" … | |
Re: Hey, You have not included the frequency analysis itself - Just the alphabet array. For example: [code] char[] aLetter = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; [/code] Needs … | |
Hello, I'm creating a Matrix, that the user can manually define the rows and columns.. (This will be defined in a class) But, I'm having trouble resizing the vector to what is set in main.. Here is the code: Matrix.h [code] #ifndef _Matrix_h #define _Matrix_h #include <vector> using namespace std; … | |
Re: [QUOTE=radc;1722245]Hi there, I am studying software engineering on my 3rd year and from time to time I think about the job I am gonna do during rest of my life.As a result I look at the trends of todays IT and application development world. There is a significant shift from … | |
Re: why is: [code] do($_POST['register']); [/code] "do" usually associates with a do-while loop: [code] <?php do (something) { }while($_POST['register'] = ''); ?> [/code] As an example! | |
Hello, I'm working with files in a C++ project AND the text file that I need to open is in the same directory, however when just trying to open it like this: [code] string inputFile = "myText.txt"; [/code] It will not open, even though it's in the same directory, so … | |
Re: Firstly because you are using a form.. Make sure you declare your using one: [code] <p>Please select the product you want to add <form method="post" action="test.php"> <label> <select name="menu1" onchange="MM_jumpMenu('parent',this,0)"> <option>Nylon Blisters</option> <option>PP plastic</option> </select> </label> <input type="submit" name="submit" value="Update"> </p> [/code] This code will just display the results of … | |
Re: Technically a string is an array? Would this be ok: [code] #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string std; cout << "Please enter your string: "; cin >> std; for(int i=0; (i < std.length()); i++) { cout << std[i] << endl; } return … | |
Re: Have you tried: [code] $result = mysql_query("SELECT * FROM users WHERE uname = '$username' AND password = '$pass'") or die (mysql_error()); [/code] ![]() | |
Hello, now it looks like this is homework help, but no - it's not! I'm trying to communicate between a C# program and a webpage, I'm generating the data into C# and wanted to export it to the webpage using JSON.. However, I can't seem to find out if it's … | |
Re: Click on the 'Mark this thread as solved' Should be near the 'Quick reply box' =) | |
Re: [code] <?php session_start(); // this initializes the session, and, should be on each of your main pages that you use // sessions. $_SESSION['string'] = "Hello, this is a string"; echo $_SESSION['string']; // this outputs Hello, this is a string. ?> [/code] - Hope this helps :) | |
Re: [QUOTE=gilgil2;1730851]I think the problem is with the "===" I am not a PHP expert, but === means that the values and variables are the same for it to be true, try "==" and see if that works.[/QUOTE] That's the way I view them =) .. [code] <?php $num = (int) … | |
Re: Hey =) I'm going to suggest a way (I think the way you want to do it, it is possible but with some .htaccess) Basically, your URL would be something like: - [url]www.thesite.com/artists.php?name=thekooks[/url] OR - [url]www.thesite.com/artists.php?id=1[/url] and then you'd have a script that looks something like this: [code] <?php $name … | |
Re: You could.. [code] if(!isset($_POST['txtapplied'])) { echo 'You have not completed this field'; }else{ $posapp = $_POST['txtapplied']; } [/code] Do it for all of them =) | |
Re: Could you please give us the code so we can try and resolve your issue :) | |
Hello, having a slight problem here.. I have a string, that I need to do character analysis on - Basically finding out how many times "B" is in the text and then ordering this from (lowest to highest). Now I can get the results, but, I don't know how to … | |
Re: Just a suggestion, might be wrong but sure mail features is turned on? I had this problem when I was working on my own server, like WAMP or MAMP. | |
Re: This compiles for me: I left the class functions (.cpp) file alone and the main but changed the class to: [code] #ifndef CHARACTER_H #define CHARACTER_H #include <iostream> #include <string> #include <vector> class Character { public: Character(); private: int health; int magic; int level; int eyeColor; std::vector<std::string> inventory; std::vector<std::string> abilities; }; … | |
Re: Just a suggestion but because you're using a menue, why not use a switch statement instead? For example: [code] #include <iostream> int x; int y; int z; void addFunc(); void subFunc(); void divFunc(); void multFunc(); using namespace std; int main() { int select; cout << "Welcome to calculator!" << endl … ![]() | |
Re: Could you please explain this: [code] $conn = mysql_connect("localhost","rentwall_rentwal",")[B]X7zlBx)XgZ5"[/B]) or die ("Could not connect MySQL"); [/code] What is X7zlBx)XgZ5? | |
Re: I don't get what you mean by "put it into a function", but I'll have a go :) [code] <?php function returnText($theText) { return $theText; } if(!isset($_POST['submitted'])) { // check that form hasn't been submitted echo '<form method="post" action="">'; echo 'Enter something: <input type="text" name="theInput" value="" />'; echo '<input type="submit" … | |
Re: What is the problem with using sessions? But to answer your question, I shouldn't think so if they cannot add items to the card (because, these will be stored within the session) so aslong as the visitor to your site can only browse and doesn't have to do anything "usery" … | |
Re: Could you please post your code (so far) So we have something to work on =) | |
Re: I think you're asking in the wrong forum category if I'm honest. If you ask in a C# coding forum, the likelihood is someone will attempt to throw code at you, why not ask in the Computer Science or something where someone can help you further? | |
Re: Your class (.h) and functions to the class (.cpp) should be in separate files and then included in main (: | |
Re: From what I can see, "name" isn't recognised (I might be wrong).. Your input needs to have a name, and the value needs to be what you process, for example: [code] <input type="image" name="myImage" value="Phorce"> [/code] And then in PHP: [code] <?php $name = $_POST['myImage']; var_dump($name); // Should display "Phorce" … | |
Re: Few questions: - Will this be updated on a weekly basis? (Each team play once a week, maybe 2 times) - Will the teams remain constant, in that, they can be called from the database for each week? =) | |
Re: Hey =) It's kind of right, the only problem is that the function is declared after the main and when it's read in main, it doesn't know yet that the function exists. Two solutions: Put the function before main: [code] # include <iostream> using namespace std; void testFunction () { … | |
Re: Can I just ask, do you want to display 20 records from the table? And each of these records have a field called 'qty' or something? Also, I don't understand what you're doing with the last part.. Are you inserting something? | |
Re: Hey, I was in completely the same situation you are in, I completely sucked at Mathematics.. But I'm studying Computer Science now, and my maths skills have improved so much! Obviously, you'll need to sit mathematic classes and exams in order to do it but it's worth it - I … | |
Re: Hey there (Think this is what you're looking for): First off your class: [code] class Sally { public: Sally(); private: }; [/code] Only have public and private/protected etc.. Not twice =) And the cpp file: [code] #include<iostream> #include<string> #include "Sally.h"; Sally::Sally(){}; [/code] Main: [code] #include <iostream> #include "Sally.h" using namespace … | |
Re: My best solution: - Run a query to get the data - Then, in your preferred language, build a map depending on the data.. There are queries and libraries which can help you achieve this =) | |
Hey, I'm building my own platform mainly for a project, but, for my own personal use as well.. I'm also changing the style of programming that I do it in, and, setting up some rules.. I just wondered if there are any disadvantages to the way that I am setting … | |
Re: What I can see is that the variable "link" contains both the href and the image itself. [code] <?php ob_start(); session_start(); if(!isset($_SESSION['Username'])) { $alt = 'Please Register'; $link = ( '<a href="http://www.test.com/signup.php"><img src=/images/register.png" alt="' .$alt. '" /></a>' ); echo $link; }else{ $alt = 'Vote'; $link = ( '<a href="http://www.test.com/thanks.php"><img src=/images/vote.png" … |
The End.