I loaded an image into a 2D array, where each index is a pixel. The image is just a white circle on black background.
I am having trouble locating the upper-most, left-most, right-most and...
Type: Posts; User: Suchy
I loaded an image into a 2D array, where each index is a pixel. The image is just a white circle on black background.
I am having trouble locating the upper-most, left-most, right-most and...
When trying to compile a simple script with Gcc:
#include <stdio.h>
#include <math.h>
int main()
{
double a = cos(360);
printf ("cos: %d\n\n", a);
That part about "taking a note "in the book got me. So what should hash (associative array) contain?
I don't get that part, could you explain it little mor or give me na example.
Thanks for...
Thanks, now I finaly get something like this when printing out the labels array
--------------------------------------------------------
---------------------------------------------------aaa--...
So any idea on how to fix this, also I hard coded that the label is a, I need to fix this since the idea is that every shape gets a new label (a,b,c,d...).
Is it posible to add someting to char to...
I am trying to implement the Sequential Labeling Algorithm, which looks at a binary image and assigns a label to each image.
int rows = im -> getNRows();
int cols = im -> getNCols(); ...
Are there rules that decide if a given program is a virus?
If I maka a simple program that creates a txt file somewhere in system directory (ex. WINDOWS\system32) and via a infinite loop writes...
Thanks for the replys, I will stick with my original way.
But thanks for the ideas.
yeah, they both contain same letters but since only 4 are read from the first string and 5 from next, these words are not anagrams
I did something simmilar way back, hope it helps:
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <string>
Because I have a function that prints contents of an array, it is used multiple times.
The first line is:
cout << "Array " << what << " = ";
what can be "created", "updated", "deleated" ......
When I call a function X in multiple places (main, from within other functions) is it possible to know each time X was called what part of the code called it, or do I have to pass flags with each...
I am having trouble converting chars into ints:
char input[100];
int in, count, i;
while ((in = fgets(fp) != EOF){
input[count] = in;
++count;
}
This is a simple problem, which I can't get right:
int openme(file)
{
FILE *fp;
fp = fopen(file, "a");
}
In Unix after I change the mode to non-canical how can I map different keys?
ex. setting Crtl-Z to do something other then quiting the program.
When I do that I get the same error as before : "function returns address of local variable"
rhe error is caused by the return line
I am trouble returning a pointer to an array back to main:
int *funct(int argc, char *argv[]);
main
int *a = funct (argc,argv);
switch (input[i])
{
case '(':
operator_stack.push(input[i]);
break;
case '+':
case '-':
...
Yes, I noticed that. Couple of commands had simmilar names, thus typing one in called the wrong function.
But since I only have few commands, I changed their names and everything is smooth.
what I want is the set value to what ever val[0] is, how can I do this?
I have a simple function that adds a node to a linked list:
node *x = new node;
cout << "enter value" << endl;
cin >> x -> value;
x -> next = head;
head = x; ...
Cool that works, thanks.
I have another idea, let me test it and I will get back.
PS.
string x;
cin >> x;
if ( x.find_first_of("add", 0) == 0)
cout << "found function 'add...
I am using if/else know to check the first token, but how can can I compare a string that looks like: add 15 without breaking it up.
cin >> x;
if (x == "add..... ??????)
I have a menu, where the user enters a command followed by a argument, ex:
add 5 // adds 5
sub 7 // sub
in x 8 // inserts x into the 8 th spot
Right now I am tokenizing the string, looking at...
Even if I make it struct stat as in the man page I get the same error, also I use this prog for testing only so I do not care how the output looks like (maybe I should :) ).
Any way how can I...