Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Counting vowels in string. "Comparison pointer-integer". Post 302579518 by laiko on Tuesday 6th of December 2011 12:22:00 AM
Old 12-06-2011
just a guess..

at line where it says
Code:
      if(*v == scanme[i]){

i don't think you are comparing each element of v. v is a pointer to an array. You may need to use something like v[counter], maybe in a nested loop.

hth

Last edited by laiko; 12-06-2011 at 01:42 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

comparison between pointer and integer

I received a warning when I tried to compile my program that said: warning: comparison between pointer and integer Could you please explain to me what this means, and in what ways I could possibly fix this? Thanks for your help! (2 Replies)
Discussion started by: sjung10
2 Replies

2. Shell Programming and Scripting

input string="3MMTQSZ348GGMZRQWMJM4SD6M";output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6

input string="3MMTQSZ348GGMZRQWMJM4SD6M" output string="3MMTQ-SZ348-GGMZR-QWMJM-4SD6M" using linux shell script (4 Replies)
Discussion started by: pankajd
4 Replies

3. Shell Programming and Scripting

cshell integer expression from "0000" to "1999"

I have 2000 files named like "file-fr0000.log", "file-fr1999.log"... I wanna generate the file names automatically in the following c shell script: set fr = 0 while ($fr <= 1999) grep "ENERGY" file-fr$fr.log > data.dat @ fr = ( $fr + 1 ) end The above will generate file names... (3 Replies)
Discussion started by: rockytodd
3 Replies

4. Programming

php stop "internal row pointer" when fetch from mysql

Hi gurus, I need to call php function for fetching data from mysql but I dont want to move internal row pointer (IRP) forward. Or even get the actual IRP position then fetch data and move IRP back to remembered position. Function mysql_data_seek() is not suitable for my example because I am trying... (1 Reply)
Discussion started by: wakatana
1 Replies

5. Programming

warning: comparison between pointer and integer

Hi guys :D I am still playing with my C handbook and yes, as you can see I have small problem as always :cool: I wrote a C code #include <stdio.h> #define MESSAGE 100 int main(void) { char input_mes - Pastebin.com And when I try to compile it I get following errors from gcc ... (1 Reply)
Discussion started by: solaris_user
1 Replies

6. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

7. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

8. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

9. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
A64L(3) 						   BSD Library Functions Manual 						   A64L(3)

NAME
a64l, l64a -- convert between 32-bit integer and radix-64 ASCII string SYNOPSIS
#include <stdlib.h> long a64l(const char *s); char * l64a(long value); DESCRIPTION
The a64l() and l64a() functions are used to maintain numbers stored in radix-64 ASCII characters. This is a notation by which 32-bit inte- gers can be represented by up to six characters; each character represents a ``digit'' in a radix-64 notation. The characters used to represent digits are '.' for 0, '/' for 1, '0' through '9' for 2-11, 'A' through 'Z' for 12-37, and 'a' through 'z' for 38-63. The a64l() function takes a pointer to a null-terminated radix-64 representation and returns a corresponding 32-bit value. If the string pointed to by s contains more than six characters, a64l() will use the first six. a64l() scans the character string from left to right, decoding each character as a 6-bit radix-64 number. If a long integer is larger than 32 bits, the return value will be sign-extended. l64a() takes a long integer argument value and returns a pointer to the corresponding radix-64 representation. RETURN VALUES
On success, a64l() returns a 32-bit representation of s. If s is a null pointer or if it contains digits other than those described above. a64l() returns -1 and sets the global variable errno to EINVAL. On success, l64a() returns a pointer to a string containing the radix-64 representation of value. If value is 0, l64a() returns a pointer to the empty string. If value is negative, l64a() returns a null pointer and sets the global variable errno to EINVAL. WARNINGS
The value returned by l64a() is a pointer into a static buffer, the contents of which will be overwritten by subsequent calls. The value returned by a64l() may be incorrect if the value is too large; for that reason, only strings that resulted from a call to l64a() should be used to call a64l(). If a long integer is larger than 32 bits, only the low-order 32 bits are used. STANDARDS
The a64l() and l64a() functions conform to X/Open Portability Guide Issue 4, Version 2 (``XPG4.2''). BSD
August 17, 1997 BSD
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy