Sponsored Content
Top Forums Programming Adding a single char to a char pointer. Post 302265363 by frank_rizzo on Saturday 6th of December 2008 10:40:24 PM
Old 12-06-2008
Quote:
Originally Posted by VRoemer
Make sure your files only have one extension with either of these solutions in the event you have files named like

myFile.tar.gz
my solution would work as it reads from the right.

myFile.tar.gz would return gz
 

10 More Discussions You Might Find Interesting

1. Programming

Regarding char Pointer

Hi, char *s="yamaha"; cout<<s<<endl; int *p; int i=10; p=&i; cout<<p<<endl; 1) For the 1st "cout" we will get "yamaha" as output. That is we are getting "content of the address" for cout<<s. 2) But for integer "cout<<p" we are getting the "address only". Please clarify how we are... (2 Replies)
Discussion started by: sweta
2 Replies

2. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

3. UNIX for Dummies Questions & Answers

how2 get single char from keyboard w/o enter

I am writing a bash shell menu and would like to get a char immediately after a key is pressed. This script does not work but should give you an idea of what I am trying to do.... Thanks for the help #! /bin/bash ANSWER="" echo -en "Choose item...\n" until do $ANSWER = $STDIN ... (2 Replies)
Discussion started by: jwzumwalt
2 Replies

4. UNIX for Dummies Questions & Answers

tab char appearing as single space?

I'm trying to run a script which will ssh to several other servers (All Solaris 10) and execute a sar -f command to get each server's CPU usage for a given hour. It kinda works OK but I just can't figure out how to separate the returned fields with a Tab character. I've done lots of searching... (2 Replies)
Discussion started by: jake657
2 Replies

5. Programming

How to get the sizeof char pointer

The below code throws the error, since the size of x = 19 is not passed to the cstrCopy function. using namespace std; static void cstrCopy(char *x, const char*y); int main () { char x; const string y = "UNIX FORUM"; cstrCopy(x,y.c_str()); return 0; } void cstrCopy(char *x,... (3 Replies)
Discussion started by: SamRoj
3 Replies

6. Programming

help with char pointer array in C

i have an array like #define NUM 8 .... new_socket_fd = accept(socket_fd, (struct sockaddr *) &cli_addr, &client_length); char *items = {"one", "two", "three", "four", "five", "six", "seven", "eight"}; char *item_name_length = {"3", "3", "5", "4", "4", "3", "5", "5"}; ... (1 Reply)
Discussion started by: omega666
1 Replies

7. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

8. Shell Programming and Scripting

Single char

Task 2: When Im tring script called char that checks a single character on the command line, c. If the character is a digit, digit is displayed. If the character is an upper or lowercase alphabetic character, letter is displayed. Otherwise, other is displayed. Have the script print an error... (0 Replies)
Discussion started by: Roozo
0 Replies

9. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies

10. Programming

Segmentation fault when I pass a char pointer to a function in C.

I am passing a char* to the function "reverse" and when I execute it with gdb I get: Program received signal SIGSEGV, Segmentation fault. 0x000000000040083b in reverse (s=0x400b2b "hello") at pointersExample.c:72 72 *q = *p; Attached is the source code. I do not understand why... (9 Replies)
Discussion started by: jose_spain
9 Replies
NE_GET_RESPONSE_HEAD(3) 					neon API reference					   NE_GET_RESPONSE_HEAD(3)

NAME
ne_get_response_header, ne_response_header_iterate - functions to access response headers SYNOPSIS
#include <ne_request.h> const char *ne_get_response_header(ne_request *request, const char *name); void *ne_response_header_iterate(ne_request *request, void *cursor, const char **name, const char **value); DESCRIPTION
To retrieve the value of a response header field, the ne_get_response_header function can be used, and is given the name of the header to return. To iterate over all the response headers returned, the ne_response_header_iterate function can be used. This function takes a cursor parameter which should be NULL to retrieve the first header. The function stores the name and value of the next header header in the name and value parameters, and returns a new cursor pointer which can be passed to ne_response_header_iterate to retrieve the next header. RETURN VALUE
ne_get_response_header returns a string, or NULL if no header with that name was given. If used during request processing, the return value pointer is valid only until the next call to ne_begin_request, or else, until the request object is destroyed. Likewise, the cursor, names, and values returned by ne_response_header_iterate are only valid until the next call to ne_begin_request or until the request object is destroyed. EXAMPLES
The following code will output the value of the Last-Modified header for a resource: ne_request *req = ne_request_create(sess, "GET", "/foo.txt"); if (ne_request_dispatch(req) == NE_OK) { const char *mtime = ne_get_response_header(req, "Last-Modified"); if (mtime) { printf("/foo.txt has last-modified value %s ", mtime); } } ne_request_destroy(req); SEE ALSO
ne_request_create, ne_request_destroy. AUTHOR
Joe Orton <neon@lists.manyfish.co.uk> Author. COPYRIGHT
neon 0.29.6 3 May 2011 NE_GET_RESPONSE_HEAD(3)
All times are GMT -4. The time now is 11:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy