User Profile

Collapse

Profile Sidebar

Collapse
davemc617
davemc617
Last Activity: Oct 16 '11, 09:39 PM
Joined: Oct 16 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • davemc617
    replied to Help with a Triangle Pattern in C language
    in C
    Ok. So I scrapped the concatenation, and now i'm trying to reallocate the strings. I may not be using the right term so here's what it looks like:
    Code:
    while(loopCount < 35)
    	{
    		for(counter = 1; counter < SIZEOF; counter ++)
    		{
    			if(line[counter] != line[counter - 1])
    			{
    				temp=line[counter];
    				line[counter]=add[0];
    			}
    		}
    		loopCount = loopCount + 1;
    		printf("\n%s",
    ...
    See more | Go to post

    Leave a comment:


  • davemc617
    replied to Help with a Triangle Pattern in C language
    in C
    Well, i'm not entirely sure what you mean by null termination. The way I went about strcat was with the if statement: if(line[counter] != line[counter - 1]). So in this case, if line[1] doesn't equal line[0] i'm trying to replace the blank spot in line[1] (the next line below) with an '&' by concatenating 'char add = "&"' into line [1]. But it appears that it is concatenating it into the rest of the entire string.

    I...
    See more | Go to post

    Leave a comment:


  • davemc617
    started a topic Help with a Triangle Pattern in C language
    in C

    Help with a Triangle Pattern in C language

    Hi there; i'm a newbie when it comes to everything coding, and I have an assignment due tomorrow. The assignment is to code a triangle that begins with an '&' in the leftmost position of EVERY line, and in the case of line 1 the remaining 49 spots of the string will remain black. In the case of the remaining lines (2-32), I must print a '&' if the position above it on the previous line and the position above it and to the left of the previous...
    See more | Go to post
No activity results to display
Show More
Working...