Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. fgs3124

    Does C have the equivalent of the C++ substring function?

    Thank you. This was very helpful.
  2. fgs3124

    Does C have the equivalent of the C++ substring function?

    I am writing a C program and need to use the equivalent of the C++ substring function to return the 1st 10 characters of a string. Does C have something similar or has anyone had to write their own function?
  3. fgs3124

    Simple Search Algorithm

    Thanks! Got the code to compile in MSVC++ v6. It appears you are passing the program some arguments . . . is that right? If so, can you give an example?
  4. fgs3124

    Simple Search Algorithm

    Here's an easy one for the experience programmers (of which I am not one of). I want to perform a simple search for a string value (eg. labor) in a text line I read in between the line positions of 0 to 10. I have done multiple searches out there and have come across the Boyer-Moore search...
  5. fgs3124

    C2106 Error Assigning a String Literal to a char Array

    # include <iostream.h> # include <string.h> int bmsearch(char *text,char *pat,int *no,int *pos) { int len=strlen(pat); int compcount=0; int ptct=len-1; int i,table[256]; *no=0; for(i=0;i<256;i++)table[i]=len; for(i=0;i<len;i++)table[pat[i]]=len-(i+1); while(ptct<strlen(text)) { int...
  6. fgs3124

    C2106 Error Assigning a String Literal to a char Array

    Here's a sample of the code. the line => &quot;token = strtok(NULL, seps);&quot; is the one that seems to cause the memory error when executing. ----------------------------------------------------------- # include <iostream.h> # include <string.h> //These two include files are mandatory...
  7. fgs3124

    C2106 Error Assigning a String Literal to a char Array

    I appreciate your response to my request for help. I tried the strcpy(pat0,pos0) and the program compiles ok but I get the following memory error when running it: &quot;The instruction at &quot;0x00401edb&quot; referenced memory (I am sure you know the rest) . . .&quot; I believe the error is...
  8. fgs3124

    C2106 Error Assigning a String Literal to a char Array

    I am a novice C programmer and I am running into the &quot;common&quot; C2106 error when attempting to assign a pointer to a string like the following: char *pos0; char pat0[100]; . . . pat0 = pos0; I realize that I can't assign a memory pointer directly to a literal string. However, I need...

Part and Inventory Search

Back
Top