Code:
char sentence[200], word[200]; char* occurs_at; int location; [i]//code to get user inputs for: sentence and word, then:[/i] occurs_at = strstr(sentence, word); [i]//a pointer (to somewhere in sentence)[/i] if(occurs_at) [i]//if true[/i]
char sentence[200], word[200]; char* occurs_at; int location; [i]//code to get user inputs for: sentence and word, then:[/i] occurs_at = strstr(sentence, word); [i]//a pointer (to somewhere in sentence)[/i] if(occurs_at) [i]//if true[/i]
int arr1[3] = {1,2,3}; // or int arr1[3]; arr1[0]=1; arr1[1]=2; arr1[2]=3;
int arr2[] = {1,2,3}; //compiler creates array of 3 and initialises them with the given values
char arr3[] = "hello world!"; //compiler creates char array of length 12+1. the last character being the '\0' to indicate end of char array (this is a special case), and initialises
void f(int*& i) { i++; }
struct Date{[indent]int dd, mm, yy;[/indent]
}
struct Employee{[indent]char* fname, *lname;
Date hiring_d;
short dept;
[/indent]
};
struct Manager : public Employee{[indent]short level; //i've tried commenting this line for furher testing but no luc[/]
#include <iostream>
int main()
{[INDENT] char* fname[3];
fname[0] = "aaa";
fname[1] = "bbb";
fname[2] = "ccc";
for(int i=0; i<3; i++)
std::cout << "\n"[/]
Leave a comment: