Hello,
was referred to this site from a friend of mine, I hope to stay here long =)
I have a homework that I just can't figure out how to do. I'm not sure if the teacher wrote it wrong(he is a bad typer) or if there is a way to accomplish the task.
I work in Visual C# 2010 Express - Console Application
My task is to:
Read a four digi...
Hi, I saw below thing in c++ standard (§9.5/1):
A union shall not have base classes. A union shall not
be used as a base class.
A union can have member functions
(including constructors and
destructors), but not virtual (10.3)
functions
From above, union can have constructor and destructor as well.
So why is it not al...
Hello Experts,
I have to write a program in C which, given the name of a day, returns all of the dates in this month that the day will be on.
For example, if the input is "Sunday" the output should be: 5,12,19,26 (which are the days Sunday will be on this month.)
Does any one have any idea how to do this? I have tried a lot. Please he...
This was a contest Q:
There are N numbers a[0],a[1]..a[N - 1]. Initally all are 0. You have to perform two types of operations :
Increase the numbers between indices A and B by 1. This is represented by the command "0 A B"
Answer how many numbers between indices A and B are divisible by 3. This is represented by the command "1 A B"....
I'm doing a program and I would like to output a menu with two submenus in a module. I only want the main menu to show when you run the program. Then from the main menu be able to navigate to the submenus and back. If anyone could find a better way doing this (which I'm positive there is) please do say so. I'm not even sure this will wor...
This is not a homework, it's more of a challenge from our prof but I'll be tagging it as one nonetheless.
The problem is to create a typing game that has 3 levels with matching difficulty, different time limits (in seconds) and scores. Now I don't have any problems with the program itself, what I'm having problem is implementing the tim...
I was asked about this question. I can only think of a O(nm) algorithm if n is the length of the 1st string and m is the length of the 2nd string.
...
I have assignment to calculate GCD of two no. by using stack frame & I write code for this -
.text
GCD:
push ebp
mov ebp,esp
1: cmp ebx,eax
je 3f
ja 2f
sub ebx,eax
jmp 1b
2: sub eax,ebx
jmp 1b
3: leave
ret
I got the answer of this code but i have question without taking mem...
Write an application in Netbeans to manage a simple DVD hire store (note: this is simply an exercise and is in not intended to accurately model a DVD stores operation exactly – for instance there is no money involved).
This program simply records and outputs some details of DVDs, customers and staff. The program will be able to process...
So I have a page that is split into 2 columns. The left column there are expandable forms that are quite long to ask the user optional product preferences. On the right side of the page there is a much shorter, 'contact details' form.
The contact details form is mandatory while all the left product preferences forms are optional. The b...
So I have a page that is split into 2 columns. The left column there are expandable forms that are quite long to ask the user optional product preferences. On the right side of the page there is a much shorter, 'contact details' form. The contact details form is mandatory.
The behaviour idea is that as the user scrolls down to complete...
for
f = n(log(n))^5
g = n^1.01
is
f = O(g)
f = 0(g)
f = Omega(g)?
I tried dividing both by n and i got
f = log(n)^5
g = n^0.01
But I am still clueless to which one grows faster. Can someone help me with this and explain the reasoning to the answer? I really want to know how (without calculator) one can determine which one grow...
I am having trouble building a regular expression with the set of strings over {a, b, c} that is an odd length with exactly one a. Here is my best attempt so far:
(bb|bc|cb|cc)*a(bb|bc|cb|cc)*
This does good for even b and c on either side of the a, but does not account for a odd b and c combination on either side of the a.
Any hint...
I have to spread rice grains on a sheet and then find the average length of the rice grains spread. Any ideas how to do this in MATLAB?
...
I'm trying to implement a structure which is basically a custom made hash table containing either nothing (NULL) or a pointer to a binary search tree object.
Anyway, I'm having trouble figuring out how to do some things, such as setting the hash table, which is an array to NULL, and also memcpy'ing BST objects from one table to another....
Dear all,
I've the following program:
#include <stdio.h>
int main()
{
int ch;
while( ch = getchar() != '\n') {
printf("Read %c\n",ch);
}
return 0;
}
No matter what I enter I get:
Read
Why is this happening and what is that weird char that I see?
Stackoverflow is not printing th...
Hello, i have an object - Employee, and i want to know how to insert this object to a map structure sorted by char* lastName field. Thanx.
My map need to contain pointers to Employee objects not the objects themselves. the key is the last name of the employee, the map need to be sorted by the employees last name, should i use multimap?
...
I have an array as:
int x[3][5]={
{1,2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15}
};
What does *x refer to?
*(*x+2)+5 refer to "8".How does that happen?
Is *(*x+2) same as *(*x)+2?
What if I do:
*n=
Where is the pointer n pointing to? if it would have been only x and not an & then it would have been the...
For an array of size N, what is the # of comparisons required?
...
The structure defined below does not have a structure name. Moreover I am unable to get the array part. Thanks in advance.
What does the values in the array of structure mean?
#include <stdio.h>
int main()
{
struct
{
int x,y;
} s[] = {10,20,15,25,8,75,6,2};
int *i;
i = s;
clrscr();
printf("%d\n",*(i+...