• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

A Little C/C++

NaOH

Diamond Member
#include "includes.h"

char * function6a (char *arg1, char *arg2)
{
char *ptr1 = NULL;
int var1;
int ii;

while (*arg1 != 0) {

var1 = 1;
ii = 0;
while ( *(arg2 + ii) != 0) {
if ( *(arg1 + ii) != *(arg2 + ii))
var1 = 0;
ii++;
}

if (var1) {
ptr1 = arg1;
break;
}
arg1++;
}

return (ptr1);
}


Analyze!
 
Sub Post()
Dim i As Integer
i = 1
Do While i = 1
Debug.Print "this thread sucks"
Loop
End Sub


Better 😉
 
Originally posted by: KLin
Private Sub Post()
Dim txtPost as string
txtPost = "This thread sucks"
Do While True = False
debug.print txtPost
Loop
End Sub

😛
 
Are you asking a question? With a 5 second glance, it looks like you're trying to write some kind of a contains method for strings. It's very poorly written though unless you're getting extra credit for obfuscation (arg1, arg2, ii... huh?).

 
use the STL string class and never work with C strings again. BTW i just did quick look and it looks it checks if the second word is a sub string of the first. if so it returns the first word. Nicer looking code would have used arg2[ii] arg1 and '\0' for checking for null char.
 
Back
Top