Questions tagged [garbage]

Garbage, refers to objects, data, or other regions of the memory of a computer system (or other system resources), which will not be used in any future computation by the system, or by a program running on it.

From a programming point-of-view, garbage is data that has been placed in random access memory space obtained from the operating system that is no longer needed. Freeing the space for reuse is called "garbage collecting".

448 questions
-2
votes
2 answers

individual char extraction in c while using messages and msgsnd

This is bugging me for days. The problem is my not so good understanding of pointers and addresses in c so i hope someone will be able to help me out. I need to pass some strings as input parameters and create as much producer processes + one…
Vedran
  • 177
  • 2
  • 9
-2
votes
1 answer

App freezes on start giving "E/dalvikvm﹕ GC_EXPLICIT freed" messages in logcat

My app is freezing on start giving continous "E/dalvikvm﹕ GC_EXPLICIT freed" messages in logcat. I am not sure what can be the problem. Sometimes it starts nice, but sometimes freezes throwing this messages. So where I should look for a problem? It…
Nikanor
  • 262
  • 1
  • 5
  • 17
-2
votes
1 answer

Why am I getting garbage value from a function call?

I am doing problem FARIDA on spoj using recursion with memoization in C as per this link . In the following code I am getting a garbage value for variable t2 on calling the function solve.I am pasting the image of the printed value of t2 on the…
dauntless
  • 413
  • 1
  • 4
  • 6
-3
votes
2 answers

Division of two numbers in printf return garbage value in c

In printf("%d", (float) 9/ (float) 5); what will be the output? Note: In printf function the format specifier is %d It seems that output would be 0 just like the below code return answer 0. float a = 9/5; printf("%d",a); [Edited] But not at all.…
Sajjad Ali
  • 91
  • 2
  • 10
-3
votes
1 answer

Why is the garbage location in the heap in C++ not designed as can be reallocated itself?

I'm learning heap and I am told if we have to reassign a pointer to a new address, we have to delete the content in the address of the heap that the pointer points to, or that content becomes garbage and may cause memory leak. Like: int* x = new…
Hang
  • 355
  • 3
  • 19
-3
votes
1 answer

Why I am getting a garbage value after entering number of test cases in the first line of the input?

Input: The first line of the input contains an integer T denoting the number of test cases. The only line of each test case contains the space separated parts of the name. Output For each case, output the properly formatted name. Constraints: 1 ≤…
A.Vik
  • 93
  • 7
-3
votes
1 answer

C++ array gives me garbage value

I just started learning c++ and came to Arrays. So what I want to do is perform some function on the array that was passed in function. So for this I tried small example #include using namespace std; void printArray(int data[]){ …
Suraj Palwe
  • 2,080
  • 3
  • 26
  • 42
-3
votes
3 answers

program returning garbage values

This program is returning garbage values in output of total marks and average marks. even after declaring s.total=0 and s.marks[15]=0 in the beginning of program //student database #include #include #include main() { …
john_conner
  • 162
  • 1
  • 14
-3
votes
1 answer

Receiving Garbage data , when file is read and printed

In the code posted below, there is problem when writing and reading a structure from a file. The output result is garbage data, I wasn't able to find a solution on my own. Operating system used: Ubuntu. #include #include…
-4
votes
1 answer

how is Java's epsilon no garbage collector a useful feature for the average developer?

I understand the uses for benchmarking between different garbage collectors and JVM developers. Also for extremely efficient programs that don't create garbage then not having a garbage collector is useful, also for very short lived programs. What…
CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186
-4
votes
1 answer

No compilation errors and, it seems, no syntax errors -- but garbage is displayed?

Working code fixed and below Here's the whole .cpp. Any thoughts why it's printing out pure garbage when the overload void display(const Kingdom kingdoms[], size_t count) function is called? File Kingdom.h #ifndef KINGDOM_H #define…
displayName
  • 155
  • 1
  • 9
-6
votes
3 answers

How should I properly FULLY delete an object? (C#, Objective-C, Java)

I haven't found or discovered a clear answer of this yet. I am not asking about a specific language but am talking about all OOP languages in general. If I have an object for example: Object obj = new Instance(); Lets say I no longer need this…
jer_francis
  • 153
  • 1
  • 11
-8
votes
2 answers

cout corrupt char*

I have written a code to print the name of 2 workers, but instead it prints garbage. cout << "highest salary: " << highestSalary.getID() << " " << highestSalary.getName() << endl; cout << "hardest worker: " << mostHours.getID() << " " <<…
1 2 3
29
30