C RUBY-ON-RAILS MYSQL ASP.NET DEVELOPMENT RUBY .NET LINUX SQL-SERVER REGEX WINDOWS ALGORITHM ECLIPSE VISUAL-STUDIO STRING SVN PERFORMANCE APACHE-FLEX UNIT-TESTING SECURITY LINQ UNIX MATH EMAIL OOP LANGUAGE-AGNOSTIC VB6 MSBUILD

# Array is printing with weird question mark symbols when printing fibonacci sequences

By : smile
Date : January 11 2021, 03:34 PM
should help you out When printing each Fibonacci sequence the first couple of sequences print in weird symbols or not at all if printing more than 8 sequences. , There are different problems in your code:
code :
``````void fibonacci(int n, int* seq) {
int i;

seq[0] = 0;
seq[1] = 1;

for(i = 2; i < n; i++)
seq[i] = seq[i-2] + seq[i-1];
}

int main() {
int *seq;
int n, i, j;

scanf("%d",&n);

// Allocate enough space for n elements:
seq = malloc(n * sizeof(*seq));

// Compute the whole series once:
fibonacci(n, seq);

// Print partial series on each row:
for(i = 1; i <= n; i++) {
for(j = 0; j < i; j++)
printf("%d ", seq[j]);

printf("\n");
}

free(seq);

return 0;
}
``````

Share :

## C - Printing Bin. File In Weird Symbols

By : Aaron
Date : March 29 2020, 07:55 AM
Does that help In register_new(), you have to send the address of buffer in order for write_register() to work properly (right now you're giving it a copy of buffer).
Replace: write_register(buffer); with: write_register(&buffer);

## printing weird symbols to output file, c++

By : Urotski
Date : March 29 2020, 07:55 AM
First problem is uninitialized elements of num[20] - elements of num have indeterminate values so accessing any of them triggers undefined behavior. You should first read them from the file or at least initialize them to some default value. The part of code that should most likely do the sorting is just completely wrong. If you'd like to implement your own function for sorting, you can pick up some well-known algorithm like e.g. quicksort - but C++ Standard Library already provides sorting function - std::sort.
code :
``````#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

{
vector<int> vec;
int value;
while (in_file >> value)
{
vec.push_back(value);
}

return vec;
}

void write_file(ofstream& out_file, const vector<int>& values)
{
for (size_t i = 0; i < values.size(); ++i)
out_file << "value #" << i << ": " << values[i] << '\n';
}

int main()
{
string input_filename, output_filename;
ofstream out_file;
ifstream in_file;

cout << "Please enter name of input file: ";
cin >> input_filename;
in_file.open(input_filename);
if (!in_file)
{
cout << "Could not open input file\n";
return 0;
}

cout << "Please enter name of output file: ";
cin >> output_filename;
out_file.open(output_filename);
if (!out_file)
{
cout << "Could not open output file\n";
return 0;
}

sort(begin(numbers), end(numbers));

write_file(out_file, numbers);

return 0;
}
``````

## Tensorflow Printing Weird Symbols: as []

By : user3493148
Date : March 29 2020, 07:55 AM
hope this fix your issue The issue is that tensorflow formats its in-progress outputs as text to be print()ed, but it is not IDLE-aware and is print()ing text terribly inappropriate for IDLE's shell. (It apparently knows that it is not printing to a standard terminal.) The worse part, for runs longer than what you did, is the omission of newline characters in the output to IDLE (unlike the terminal output). This is exactly the wrong thing. A single line somewhere longer than 10000 characters will eventually freeze the underlying tk graphics framework.
Judging from this screenshop for bpo issue 37762, the rectangles might be inverse bullets either output by Tenserflow or used by the tk Text widget as 'replacement' characters. It might help if you could paste a copy of the rectangles into the following line and run it.

## Why is JSoup printing a question mark

By : pregnu
Date : March 29 2020, 07:55 AM
may help you . As you haven't said what you are running your program in it is difficult to give a definitive answer, but basically there is nothing wrong with your code. JSoup is not responsible for your display problem, whichever console you are displaying on is the problem.
If you set your console (or IDE) to the UTF-8 encoding it should display correctly.

## Printing a question mark after a loop

By : Enzo Darling
Date : March 29 2020, 07:55 AM
this one helps. You are resetting i after each character read. That is effectively making you erase whatever was stored. you need to move i = 0; from inside the first while loop to just after it.