Jul 25, 2008

Removing Characters...

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > C/C++ Programming

free web hosting

Removing Characters...

kvarnerexpress
From the environment variables, i get the domain of the referring site using SERVER_NAME. The includes www. and i have to remove that. I dont believe there is a variable in the environment that contains only the domain.

So I would need to replace each character in the char* string by "" until i hit a '.' then replace the dot with "" and get the remaining string. Here is the catch. I can't include big headers because i need the file to stay really small around 20-30kb. So ideally, would need to use functions in stdlib.h stdio.h or string.h to get this done.

Thanks in advance

Reply

kvkv
Here is an easy solution for your problem.

CODE

{servenv++;}while((*servenv)!='.'); //increment char* till next character to '.'
//use servenv here. it points to next character of the first '.'


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : removing characters

  1. Isolating Integers From Characters? - (4)
  2. Weird Characters Appending To File - (2)
    Anytime I open a file and close it without changes, weird characters show up. Here is the code:
    PHP Code: inFile = fopen("serefs.dat","rb"); outFile = fopen("tempfile.dat","wb"); while
    (!feof(inFile)) { char line ; char timeline ; fgets(line,512,inFile);
    strncpy(timeline, line, 10); timeline = '\0'; int filetime;
    filetime = atoi(timeline); if(filetime > (realtime - 86400)) {
    fputs(line,outFile); } } fclose(inFile); fclose(outFile); //Put tempfile in buffe...



Looking for removing, characters

Searching Video's for removing, characters
advertisement



Removing Characters...



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE