You are reading the code from the server instead of the dialogue. You need to increase the available space for Poptropica on your computer (right click on the screen to change your Flash Player settings). You may need to clear your browser cache to get the island to work correctly.
(On Firefox, this is Ctrl+Shift+delete, and you should probably not check "cookies")
You are seeing the names of the word balloons instead of the conversations. You may need to clear your computer's cache to remove bad page information before the dialogue will work correctly. You also may need to adjust your settings on Flash Player. Some islands need more graphics memory than others.
For while loop you have to define conditions for the loop in loop's body. In, "for loop" case it's more natural and comportable. For loop is good for numeric simulations in other words when you are using only numbers. Loop while is very good for symbolic conditions, for instance, to check the condition that char1 == char2;
#include<stdio.h> #include<conio.h> #include<string.h> #include<process.h> char a[20],b[50],c[50],ch; int i=0,n; void sender(); void receiver(); void main() { clrscr(); sender(); receiver(); getch(); } void sender() { int j=0,pos; printf("\n\n Sender side \n\n"); printf("Enter string : "); scanf("%s",&a); n=strlen(a); printf("\n Enter position : "); scanf("%d",&pos); label: if(pos>n) { printf("\n Invalid position, Enter again : "); scanf("%d",&pos); goto label; } printf("\n Enter the character : "); ch=getche(); b[0]='d'; b[1]='l'; b[2]='e'; b[3]='s'; b[4]='t'; b[5]='x'; j=6; while(i<n) { if(i==pos-1) { b[j]='d'; b[j+1]='l'; b[j+2]='e'; b[j+3]=ch; b[j+4]='d'; b[j+5]='l'; b[j+6]='e'; j=j+7; } if(a[i]=='d' && a[i+1]=='l' && a[i+2]=='e') { b[j]='d'; b[j+1]='l'; b[j+2]='e'; j=j+3; } b[j]=a[i]; i++; j++; } b[j]='d'; b[j+1]='l'; b[j+2]='e'; b[j+3]='e'; b[j+4]='t'; b[j+5]='x'; b[j+6]='\0'; printf("\nframe after stuffing : %s" ,b); } void receiver() { int j=6; printf("\n\n\n\n Receiver side\n\n"); printf("\nThe data came from sender side is : %s",b); n=strlen(b); while(j<n-6) { if(b[j]=='d' && b[j+1]=='l' && b[j+2]=='e') { if(b[j+3]=='d' && b[j+4]=='l' && b[j+5]=='e') { c[i]=b[j+3]; c[i+1]=b[j+4]; c[i+2]=b[j+5]; i = i+3; j = j+6; } else if(b[j+4]=='d' && b[j+5]=='l' && b[j+6]=='e') { j = j+7; } } else { c[i]=b[j]; i++; j++; } } printf("\n\nOriginal data : %s",c); }
#include<iostream> #include<vector> int main() { std::vector<int> v {1, 4, 8, 15, 23}; // initialise array with 5 elements v.push_back (42); // add a 6th element for (auto i : v) std::cout << i << std::endl; // print array elements }