Member Avatar

Forgive me if this is somewhat basic. If have an array of 20 strings defined: char const commands[20][20] = {// each command string will have a maximum of 20 chars. "quit", "open", "save", "close" }; I want to test the command value to see what action should be taken. int in_array(char array[], char txt[], int len){ for(int i=0;i<len;i++){ if(txt==array[i][0]){ return i; } } return -1; } What is the best way of doing this? I am currently getting an error: `/home/dave/projects/fullpage/action.cpp:15:20: error: invalid types ‘char[int]’ for array subscript` I'd hapily use `include <strings>` but I get a similar error.

Member Avatar
0
40
Member Avatar

Hello, I have this program that will check and see if the email address the user entered contains valid characters and the @ and . character. The only problem is that my program isn't working... When I enter a valid email address it says it is invalid, when I enter an invalid email address it also says it's invalid. Here is my code: procedure TForm1.btnValidateClick(Sender: TObject); var sEmail: string; bResult: boolean; i: integer; iPos: integer; const ALLOWED = 'abcdefghijklmnopqrstuvwxyz0123456789_'; begin sEmail := edtEmailAddress.Text; i := 1; bResult := false; { Check to see if there is an @ in the …

Member Avatar
0
32
Member Avatar

greetings here in saudi arabia.i come in peace.i have a problem in search hope you guys have time answering this. i have a datagrid table a textbox and adodc controller.if i input the characters in textbox i want to see only the characters that i have entered and the other will not be shown in the table of datagrid.hope u understand what i mean.thanx in advance for answering this.

Member Avatar
0
25
Member Avatar

Sir I have a search engine on my website which get input by user and search it for the results and i am storing those keywords into seperate table name keywords, but now a days i m checking that there is a bunch of unknown characters into query strings, i have used htmlspecialchars() funcntion and mysql_real_escape_string() functions to check if it will help me but i m not success i have attached the db image to you guyz to check and help me out, and also give me a mysql query to so with at once i can remove those …

Member Avatar
0
41
Member Avatar

Hello frinds. i want to create a blog.in a table will be a short brief about any story.and when thhe user clicks on a part of that short text it will direct him into a full page with the full text.I have puted them into a table but i dont know how to code it to display only 100 chars of that string.i have stried substring but it want work.any idea ? thx

Member Avatar
0
4
Member Avatar

OK, so here's the deal. I'm trying to create 2 programs, a server and a client, which communicates between them. I'm working on Ubuntu, throughout FIFO. So, 1st of all, I create 2 FIFO's: $ mkfifo pipe $ mkfifo pipo Ok, and after that I create the client and the server programs. My objective is that, when running both programs (in two separate terminals) when I enter an input from the client's terminal, the server would take that input and use it to get some informations. Now my client sends a directory name, and the server will perform a ls …

Member Avatar
0
6
Member Avatar

Hi all, I am looking to understand Html entities & html special chars in more details. I have a form and text area that users complete, the databse updates correctly and displays the information. The problem im facing is this: When the database displays the data, its display incorrectly. For example: If the user enters Line 1 Line 2 Line 3 The data is stored correctly in the database, including the line brakes. But when the data is displayed on the page, it is displaying as Line 1 Line 2 Line 3 ? How can I display the data from …

Member Avatar
0
7
Member Avatar

Well i made another thread but with a different problem but i fix it. but i know how to make textbox allowed chars but is possible with web browsers ? like if f1 - f12 is pressed then nothing happen like nothing have been touch. is possible ? if so any help ?

Member Avatar
0
2

The End.