569 Posted Topics

Member Avatar for phorce

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 …

Member Avatar for phorce
0
122
Member Avatar for phorce

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 …

Member Avatar for histrungalot
0
164
Member Avatar for phorce

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 …

Member Avatar for ravenous
0
118
Member Avatar for phorce

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] …

Member Avatar for phorce
0
205
Member Avatar for phorce

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 …

Member Avatar for mrnutty
0
107
Member Avatar for clerisy

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{ …

Member Avatar for raovishal
0
105
Member Avatar for phorce

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.. …

Member Avatar for WaltP
0
236
Member Avatar for porkchop970

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 …

Member Avatar for vaultdweller123
0
206
Member Avatar for phorce

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 …

Member Avatar for ctaylo21
0
106
Member Avatar for hekri

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: " …

Member Avatar for hekri
-1
266
Member Avatar for phorce

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 …

Member Avatar for phorce
0
1K
Member Avatar for accra

Think you'll find it uses both jQuery (Javascript) / PHP.. There isn't an actual way to do it in pure PHP.

Member Avatar for accra
0
70
Member Avatar for phorce

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 …

Member Avatar for WaltP
0
63
Member Avatar for phorce

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" …

Member Avatar for phorce
0
130
Member Avatar for Youg

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 …

Member Avatar for phorce
0
486
Member Avatar for phorce

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; …

Member Avatar for VernonDozier
0
2K
Member Avatar for radc

[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 …

Member Avatar for Dexxta27
0
192
Member Avatar for asisani123

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!

Member Avatar for pzuurveen
0
185
Member Avatar for phorce

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 …

Member Avatar for Narue
0
12K
Member Avatar for sidra 100

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 …

Member Avatar for sidra 100
0
97
Member Avatar for gdubz

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 …

Member Avatar for subith86
0
129
Member Avatar for gcarvalho

Have you tried: [code] $result = mysql_query("SELECT * FROM users WHERE uname = '$username' AND password = '$pass'") or die (mysql_error()); [/code]

Member Avatar for diafol
0
452
Member Avatar for phorce

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 …

Member Avatar for gusano79
0
128
Member Avatar for billmudry
Member Avatar for phorce
0
173
Member Avatar for jonnyboy12

[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 :)

Member Avatar for phorce
0
46
Member Avatar for jacksantho

[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) …

Member Avatar for gilgil2
0
5K
Member Avatar for gilgil2

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 …

Member Avatar for phorce
0
130
Member Avatar for shielaolid

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 =)

Member Avatar for mikulucky
0
118
Member Avatar for shielaolid
Member Avatar for phorce
0
146
Member Avatar for phorce

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 …

Member Avatar for phorce
0
129
Member Avatar for davy_yg

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.

Member Avatar for davy_yg
0
184
Member Avatar for Hawkpath

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; }; …

Member Avatar for Hawkpath
0
8K
Member Avatar for KingAudio

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 …

Member Avatar for eckoro
0
145
Member Avatar for akhtar.ali803

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?

Member Avatar for phorce
0
167
Member Avatar for pauls9

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" …

Member Avatar for phorce
0
125
Member Avatar for anthonyjpv

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" …

Member Avatar for phorce
0
164
Member Avatar for Kunal0
Member Avatar for ravenous
0
288
Member Avatar for suneye

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?

Member Avatar for phorce
0
57
Member Avatar for wanguard

Your class (.h) and functions to the class (.cpp) should be in separate files and then included in main (:

Member Avatar for adityatandon
0
174
Member Avatar for GreaseJunkie

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" …

Member Avatar for phorce
0
143
Member Avatar for MargateSteve

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? =)

Member Avatar for MargateSteve
0
213
Member Avatar for jmcparlin1

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 () { …

Member Avatar for adityatandon
0
164
Member Avatar for leechyeah

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?

Member Avatar for leechyeah
0
392
Member Avatar for MooGeek

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 …

Member Avatar for vegaseat
0
163
Member Avatar for JonnyFrond
Member Avatar for Christing
0
156
Member Avatar for Raisefamous

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 …

Member Avatar for Raisefamous
0
223
Member Avatar for rahulroshan

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 =)

Member Avatar for Webmastergrace
0
94
Member Avatar for CALIBER
Member Avatar for thines01
-1
64
Member Avatar for phorce

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 …

Member Avatar for phorce
0
200
Member Avatar for GreaseJunkie

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" …

Member Avatar for GreaseJunkie
0
4K

The End.