I guess the fun exercise is to try writing your own version of vector.
Type: Posts; User: Salem
I guess the fun exercise is to try writing your own version of vector.
You could send a pm to webmaster.
> char* labels [NUMMENUS];
> bool selected[NUMMENUS];
Array sizes are compile time constants in C++.
You're trying to make it variable.
Perhaps you should be looking at say std::vector,...
> thanks for the advice. I changed scanf("%s, name) for gets(name) and now its working.
No no no no no!!!!
NEVER EVER USE gets()
Seriously!
c - Why is the gets function so dangerous that it...
I rather suspect OP has been getting overly generous marks from their tutor up until this point.
This code needs an 'F', regardless of whether it finally produces the right answer or not. The...
Well,
char str[5];
sprintf(str,"%d",compute);
Saying strlen(str) > 2 is just the long way of saying compute >= 100.
You can create a program that opens a port and listens for connections that your browser can make - yes.
Or are you thinking about this?
Selenium Projects
So, while you're copy/pasting your way to 600+ lines, I made a sampler.
#include <iostream>
#include <iomanip>
using namespace std;
class Board {
private:
char board[3][3][3];
First, fix these.
foo.cpp: In function ‘int LauraAI()’:
foo.cpp:20:66: error: ‘printf’ was not declared in this scope
printf ("\nLaura-AI chose board %d to play in\n", BoardChoice);
...
Nothing you have in main at the moment can correctly call checkSizesLast() with any amount of casting or dereferencing.
checkSizesLast is expecting an array (of some dimensions) who's most basic...
> i tried to redirect STDOUT to the socket but I didn't get what I need
Post your example of what didn't work.
> Your instructor is wrong. However, you probably should do things the way he wants anyway.
Or send the instructor here for better education, or just forward them the message threads.
A stack is a LIFO (Last In, First Out) data structure.
That is, you 'push' and 'pop' from just one end.
A queue on the other hand is a FIFO (First In, First Out) data structure.
You 'push' on...
Why are you basing your rng() on time() and clock().
Which, depending on how often you call them, return
- the same as last time
- +1 from last time
- always some number greater than last time....
You need to show us your StrStackPush() and how you call it.
Because if you don't know where your strings are, chances are - you're doing it wrong.
#include <stdio.h>
int main(void)
{ // start scope1
int i = 2; // i begins at this ;
for (int j = 0;/* j begins at this ;*/ j < 5; ++j)
{ //start scope2
// j can be only...
> If I have a list of 1 ,2, 3, 8, 9, 9, 21, 31, 45, 71 and 124, I would get a price 868, but the correct answer is 849. It must be a different principle.
Maybe you're allowed to rearrange the...
There are several problems.
1. Your code looks like dog-food. The indentation is awful, and probably hiding your mistakes.
#include <unistd.h>
#include <stdio.h>
#include <string.h>...
Hence gcc has a specific warning to detect these kinds of feature abuse.
$ gcc -Wshadow foo.c
foo.c: In function ‘main’:
foo.c:8:9: warning: declaration of ‘a’ shadows a global declaration...
Use sscanf() or strtol() on your input string.
difference between Inheritance and polymorphism - Google Search
The whole point of a doubly linked list is to avoid the nonsense of list reversal.
If you want to traverse it backwards, you just start at tail, and follow all the node->prev until you get to NULL.
Between the <> and [next] activity, you put a [work] activity box.
Work being whatever it is you want to do with a node in your list.
Are you suggesting there is a different price to pay if the log is cut in the order 4, 7, 6, 3 compared to say 7, 4, 6, 3
Your true loop needs to end up pointing back at the <>
You've got it pointing back at "set pointer to the head of the list".