Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
83 views

When I set a DEBUG trap in Bash like this: set -o functrace trap 'echo "# $BASH_COMMAND" >&2' DEBUG Suddenly, this function stopped working: getBase() { local base="$1" ...
Maestro's user avatar
  • 9,846
0 votes
0 answers
216 views

I'm trying to convert the unsigned long integer converted_binary, which contains 10000000000 to a string, but sprintf converts it to a single character 1 instead. I am able to know this through the ...
Olamide Olanrewaju's user avatar
0 votes
1 answer
101 views

Here is a simple module containing a down counter: import chisel3.util.{Valid, DeqIO} class Input(WIDTH : Int) extends Bundle { val x = UInt(WIDTH.W) } class Output(WIDTH : Int) extends Bundle { ...
Gaslight Deceive Subvert's user avatar
1 vote
1 answer
134 views

I am learning how to create struct's and I am stuck on a program I made. Everything works fine until I try to input "2". When the program prints the symbol it's supposed to be "He" ...
Nightmare Sky's user avatar
0 votes
1 answer
73 views

I finished the challenge and my first C code worked apparently well, returning each time the correct minimum number of coins needed for change. Then when I tried to "clean it up" a bit and remove a ...
Daniel Fernandez's user avatar
0 votes
1 answer
535 views

See my code char t[]= "{\n abcdeffgjejgjergnjkengkknkn \n"; printf("%s",t); char t1[]= "{ abcdeffgjejgjergnjkengkknkn \n aaffdefa"; printf("%s",t1); Actual Output: { { abcdeffgjejgjergnjkengkknkn ...
jtro's user avatar
  • 151
1 vote
3 answers
775 views

I can't understand why the following code outputs 10. What I understand is that !printf("0") means !0, which is TRUE. So why doesn't the code print "Sachin" #include <stdio.h> int main() { ...
Debmalya Panday's user avatar
-1 votes
1 answer
1k views

I have a string array in a matlab script called "dataString" that was copied into MATLAB from an html document using fileread(). I then cut out the part I wanted and stored that in dataString. TEXT =...
Unique Worldline's user avatar
0 votes
2 answers
1k views

Language is C. I have an array of char* types (char *array[] / char** array) as function argument, and I want to print them all to separate lines like this: while (*array) { printf("%s\n", ...
Ville Miekk-oja's user avatar
2 votes
1 answer
8k views

I want to pass application printf log messages to the /var/log/messages. Because kernel debug messages can be visible to /var/log/messages.But i am not getting how to pass application printf log ...
Deepak Singh's user avatar
  • 1,169
-1 votes
1 answer
457 views

I have main.cpp, linking test function from io.c #include <iostream> #include "io.h" int main(int argc, char **argv) { test(); return 0; } io.c: #include <stdio.h> #include "io....
Kopro's user avatar
  • 1
0 votes
1 answer
760 views

I'm trying to port software to a microcontroller (so I can't step through the code with e.g. gdb) and it crashes unpleasantly. To identify the reason for this, I want to insert a printf() before every ...
user1273684's user avatar
  • 1,619
0 votes
1 answer
581 views

in c code I frequently use printf debugging macros like #define DPRINT_INT(i) fprintf(stderr,"%s has the value %i at line %i", #i,i, __LINE__) and then i can do things like DPRINT_INT(height) where ...
Roman A. Taycher's user avatar
6 votes
2 answers
8k views

I am trying to understand a Linux kernel module and would like to see the output of pr_debug and printk. I am using GNU Make. I understand that to get pr_debug messages, we have to use DDEBUG. ...
db42's user avatar
  • 4,554
8 votes
11 answers
3k views

I remember when I was in some course of C programming, a teacher once suggested that I use printf to watch the execution of a program that I was trying to debug. This program had a segmentation fault ...
YuppieNetworking's user avatar
-1 votes
2 answers
138 views

I was once asked during an interview the following question, and I've still never been quite clear on the answer. I was wondering if anyone knew where I could learn more, googling hasn't been much ...
user avatar
330 votes
11 answers
249k views

When I'm running a simple Ruby script, what's the easiest way to dump an object's fields to the console? I'm looking for something similar to PHP's print_r() that will work with arrays as well.
roryf's user avatar
  • 30.2k