Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How can one protect the piracy of his software?

JuggizMJuggizM Member Posts: 14
Hey I was wondering if anybody could help me with what is probably a very simple problem.

I am trying to read thru an array that i read from a file XXXXX.cpp
and I'm trying to remove anything that is a comment
and I have removed // comments but i cant remove * comments.

if (array[i]=='')
{
if (array[i+1] =='*')
{
while (array[i] != '*' && array[i+m1] != '')
{
array[i] = ' ';
i++;
}
}


this is a small part of my function where it removes the comment by deleting everything between * and *.

and i get a problem where the '' brings about a unterminated character constant i was wondering if anybody new either a way around this or a better way of doing this.
thanks


Comments

  • JuggizMJuggizM Member Posts: 14
    [b][red]This message was edited by JuggizM at 2002-10-19 13:50:36[/red][/b][hr]
    OK sorry i made a stupid mistake in my file before which confused me on slash and back slash.

    but i have a very similar question which is how do i search an array for a ' i have tryed to get it using ''' but that was clearly not going to work and evidently didn't
    so if somebody knows of a way to search an array for ' then i would be very grateful
  • beirowerribeirowerri Member Posts: 109
    : [b][red]This message was edited by JuggizM at 2002-10-19 13:50:36[/red][/b][hr]
    : OK sorry i made a stupid mistake in my file before which confused me on slash and back slash.
    :
    : but i have a very similar question which is how do i search an array for a ' i have tryed to get it using ''' but that was clearly not going to work and evidently didn't
    : so if somebody knows of a way to search an array for ' then i would be very grateful
    :
    I don't understand. Please reexplain.
  • JuggizMJuggizM Member Posts: 14
    sorry what I am trying todo is find the single quotations in an array (')
    but i can't search thru
    if(array[i] == ''')
    because it gives me errors
    so I'm asking if there is another fairly basic way to search for an single quotation within a char array
  • beirowerribeirowerri Member Posts: 109
    : sorry what I am trying todo is find the single quotations in an array (')
    : but i can't search thru
    : if(array[i] == ''')
    : because it gives me errors
    : so I'm asking if there is another fairly basic way to search for an single quotation within a char array
    :

    Sorry, I can't get around the problem eiter. Try replacing single quotes with double quotes in the array or another substitute if possible as a way of getting around this problem. I hope this helps.
  • PatLDDDPatLDDD Member Posts: 30
    [b][red]This message was edited by PatLDDD at 2002-10-19 20:16:16[/red][/b][hr]
    [b][red]This message was edited by PatLDDD at 2002-10-19 20:15:22[/red][/b][hr]
    : : sorry what I am trying todo is find the single quotations in an array (')
    : : but i can't search thru
    : : if(array[i] == ''')
    : : because it gives me errors
    : : so I'm asking if there is another fairly basic way to search for an single quotation within a char array
    : :
    :
    : Sorry, I can't get around the problem eiter. Try replacing single quotes with double quotes in the array or another substitute if possible as a way of getting around this problem. I hope this helps.
    :

    Hello,

    You should go with
    if( array[i] == ''' )
    // Do somethig constructive

    Yes, you must put a before the char you whant to check...

    It's not always the case but there are some exception like :
    ' and and there is probably more.

    Pat
  • Andre YoungAndre Young USAMember Posts: 0

    ________ // http://forcoder.org // free ebooks and video tutorials about || Java, Assembly, Objective-C, Visual Basic, Swift, Go, C, Scratch, Python, Ruby, PL/SQL, R, PHP, JavaScript, Delphi, C#, Perl, MATLAB, Visual Basic .NET, C++ ABAP, COBOL, Transact-SQL, Scheme, FoxPro, SAS, Prolog, Kotlin, Julia, Erlang, Crystal, LabVIEW, Hack, Scala, Apex, Alice, ML, Awk, F#, Logo, Bash, VBScript, Lisp, Dart, Clojure, Fortran, Lua, Ada, D, Rust || _________

Sign In or Register to comment.