logo
Tags down

shadow
Home » c

c

Is it possible to declare a function in header file with unknown type that is specified only in file '.c'?
will be helpful for those in need I can give specific details of implementation if needed but the general question is the following: , Your comment:
TAG :c
Date : September 14 2020, 12:00 AM , By : Govardana Reddy
How to properly fscanf txt file in C
Hope this helps For example: 1 Tutti/Leeloo/853811356; N , " %d %[^/]/%[^/]/%[^;];%[^\n]" - this is the right answer, thank you
TAG :c
Date : September 13 2020, 11:00 PM , By : Amit Kumar
why use of %n in printf() is not printing the number of variable occurrence before %n In C?
With these it helps , Per C 2018 7.21.6.1 8, for the conversion specifier n:
TAG :c
Date : September 13 2020, 10:00 PM , By : Mike Uryevich
How to make nftw() faster
Hope that helps In the page that you linked, there is this explanation for this behavior:
TAG :c
Date : September 13 2020, 07:00 PM , By : Carol B.
C - sleep() in threads gives problems
may help you . printf is line buffered, meaning it won't flush the buffer to screen until it reaches a newline "\n", or when the buffer is full. When you don't sleep, the buffer fills up quickly and prints to screen when it gets full, but when you do
TAG :c
Date : September 13 2020, 07:00 PM , By : karthiksaya
how to check if a directory is on a local disk or a remote disk in C or fortran?
wish helps you In C on Windows, you are probably looking for the Windows API function GetDriveType. To find the current working directory, you can use the function GetCurrentDirectory. However, according to the documentation, it is sufficient to simp
TAG :c
Date : September 13 2020, 06:00 PM , By : strife
How can I debug functions in shared object libraries with GDB?
it fixes the issue I'm trying to verify the functionality of functions in a shared object library. In programs with a main function, I would simply start the program and gdb would automatically breakpoint on main, but that's obviously not available h
TAG :c
Date : September 13 2020, 01:00 PM , By : Ray Diansyah
Calculating n! and x^n and proceeding the calculation
fixed the issue. Will look into that further Write a C program to calculate (x^n)/(n!) where x is a floating point number and n is an integer greater than or equal to zero. , In your question I have recognize 3 problems.
TAG :c
Date : September 13 2020, 09:00 AM , By : Tichafara A Ndoro
Proper fscanf in C
it helps some times There are multiple errors in the scanf format. Here is the correct scanf format string:
TAG :c
Date : September 13 2020, 09:00 AM , By : totino56
Program Skipped An Input
To fix the issue you can do Check the below line. You should end the quote before comma(),just replace
TAG :c
Date : September 13 2020, 08:00 AM , By : Андрей Тищенко
Easiest way to determine which file is included in C?
will be helpful for those in need I do usually generate dependencies in my Makefile with the following command line:
TAG :c
Date : September 13 2020, 05:00 AM , By : jermyn quek
Basic C Pointers
Hope this helps You do not need to have this line in your code if you just want to print the address of x.
TAG :c
Date : September 12 2020, 11:00 PM , By : Dhaval Gohel
How to resize the height of title bar in Windows API?
Does that help What you are asking is: How do I adjust the sizing of the non-client area of a Win32 window?This is probably what you want:
TAG :c
Date : September 12 2020, 11:00 PM , By : Jonas Marquez
is it safe to write to a file in another thread?
This might help you You need to call pthread_join() in the child process to avoid potential race conditions during the child process’s exit sequence (for example the child process can otherwise exit before its thread gets a chance to write to the fil
TAG :c
Date : September 12 2020, 06:00 PM , By : Md Kalimullah Mith
Getting segmentation fault while assigning values to a nested structure
To fix this issue It is because struct Address *add[2] is an array of pointers to Address type structure. Those pointers are invalid because you didn't allocated them. It should be something like this
TAG :c
Date : September 12 2020, 04:00 PM , By : Ibrahim Salah
I have a problem with scanf and giving input a char array with a for loop?
fixed the issue. Will look into that further Your scanf function is catching a carriage return (see Jonathan Leffler comment), using getchar() can solve this, like so:
TAG :c
Date : September 12 2020, 04:00 PM , By : Sreya Sringa
2 while loops in a function in C
will help you I've ran your program and it seems the second while loop terminates the function. The second while loop will read the characters from the file and will do so until it reach the end, then will exit. Both while loop executes, but the firs
TAG :c
Date : September 12 2020, 04:00 PM , By : Srinivas Kusuma
user creates the name of the file from standard input
around this issue I want my C program to ask the user to type the name of the file he wants to open and print the contents of that file to the screen. I am working Dev-C.Can you describe how can i do this or can you make an example for me? , Here is
TAG :c
Date : September 12 2020, 03:00 PM , By : Rizzz Technologies
Bitshifting of a number in C
Does that help The long in the C program's memory will be raw binary, so the first step is to split it up into decimal format digits. This is done by repeatedly dividing the number by 10 and grabbing the remainder. The LS digit of the number is alway
TAG :c
Date : September 12 2020, 05:00 AM , By : Rick Carmichael
When is the sum of series 1+1/2+1/3+1/4+......+1/n=log n and when is the same sum equal to n, i.e. 1+1/2+1/3+1/4+......+
this one helps. For the former, the inner loop runs approximately (exactly if n is a power of 2)
TAG :c
Date : September 12 2020, 02:00 AM , By : Achim
How does return actually returns in C?
To fix the issue you can do Neither. DAT_1001b50C >> 0x10 0x7fff is (DAT_1001b50C >> 0x10) 0x7fff. This shifts the value of DAT_1001b50C right 16 bits and performs a bitwise AND with 0x7fff, which keeps the low 15 bits and clears the remaining bits
TAG :c
Date : September 11 2020, 12:00 PM , By : HSOH
Question about writing to a file in Producer-Consumer program
To fix this issue I have to write two separate programs, which one is a Producer and second is a Consumer (both running in separate terminals). I provide an argument to the Producer which can be a text or a single character. Then, producer creates a
TAG :c
Date : September 11 2020, 08:00 AM , By : Herobs
Run valgrind on cross compiled executable
will help you Cross compile valgrind, and execute on the target. There are no other ways. Can't even use qemu to execute valgrind.
TAG :c
Date : September 11 2020, 08:00 AM , By : Firuz Kosimov
C modulo operator behaving unusually with randomly generated integer in my code
help you fix your problem 6327 % 40 is 7. If the screen has 23 in the position of the 7 from a previous print, printing "x mod 40: 7" will appear to have printed "x mod 40: 73".Try something along the lines of one of these alternatives:
TAG :c
Date : September 11 2020, 07:00 AM , By : pepe.carvalho
how can I implement paging , and find physical memory address knowing virtual address
To fix this issue Assuming you're trying to identity map the first 4 MiB of the physical address space:a) for unsigned int __FIRST_PAGE_TABLE__[0x400] __attribute__((aligned(0x1000))); it's a local variable (e.g. likely put on the stack); and it will
TAG :c
Date : September 11 2020, 06:00 AM , By : Long Lê Văn
Method to pass double to void * argument
hope this fix your issue The size of a pointer has nothing to do with the size of the element it points to!A 4 byte pointer can without problem point to an element which is 8 bytes or 32 bytes or whatever size.
TAG :c
Date : September 11 2020, 02:00 AM , By : Neilj244
Why can't I reproduce floating-point issues with pow function?
fixed the issue. Will look into that further pow has double arguments and return value (cppreference.com). double has 53 bit significand precision (Wikipedia). On the other hand maximum value in the example is 1000000000, which has 30 bits, so perfec
TAG :c
Date : September 10 2020, 12:00 PM , By : Aasif Malik
variadic macro that handles last argument in a different way
should help you out You can apply the macro argument counting trick. For up to five macro arguments (the original answer supported 4 macro arguments, so you can view the diff to see how to extend the macro for additional arguments):
TAG :c
Date : September 10 2020, 03:00 AM , By : Carl
Defining #if preprocessor condition in C
I wish this help you You can use a trick that provokes a compile time error if a condition is not met:
TAG :c
Date : September 09 2020, 06:00 PM , By : Antonis Terzakis
Assign array to double pointer
like below fixes the issue double** is a pointer to pointer. Of course the (outer) pointer could point to some array, too:
TAG :c
Date : September 09 2020, 03:00 PM , By : Marc Riggs
Understanding Array of pointers
To fix this issue I am doing something like this;
TAG :c
Date : September 09 2020, 05:00 AM , By : Aditya yadav
segmentation fault (core dumped) error in a c program for combination function
around this issue The value of 13! is 6227020800 which is too large to fit into an 32 bit integer. By attempting to calculate this factorial or larger results in overflowing a 32 bit int. Signed integer overflow invokes undefined behavior.In some cas
TAG :c
Date : September 08 2020, 05:00 PM , By : jitendra
Square root [ASM]
wish of those help The most fundamental issue with this code is that you wrote your own function prologue and epilogue. You have to do that when you are writing .ASM files entirely by hand, but you have to not do that when you write "inline" assembly
TAG :c
Date : September 08 2020, 01:00 PM , By : Garxoza
C fastest way to continously write data to file
I wish did fix the issue. The optimal performance will depend on the hard drive, drive fragmentation, the filesystem, the OS and the processor. But optimal performance will never be achieved by writing small chunks of data that do not align well with
TAG :c
Date : September 08 2020, 12:00 PM , By : Gurinder Batth
Why program is outputting right and wrong results for same condition
hop of those help? I have been solving a problem of the dynamic array on the hackerrank. The problem is of organizing books on shelves of a library. Here is the link to the question. , One obvious error is here:
TAG :c
Date : September 08 2020, 10:00 AM , By : Gabriel Saccani Nove
Is there a way to join for a specific thread, knowing only its ID?
I think the issue was by ths following , When you create a pthread with pthread_create, you pass in a pthread_t* to receive the thread ID. You can then wait for that thread to complete by calling pthread_join and passing it that thread ID.
TAG :c
Date : September 08 2020, 08:00 AM , By : j.saatu
C counter for specific punctuations
I wish this helpful for you Single quotes are characters (char), double quotes are null-terminated strings (char *).
TAG :c
Date : September 07 2020, 11:00 PM , By : Tom Crisp
Delete current terminal input line
To fix this issue I think you should look into ncurses as Edd said in his comment. It would allow you to easily manage contents in your terminal window, which sounds like a good idea for your chat program. All you'd need to do is store your messages
TAG :c
Date : September 07 2020, 10:00 AM , By : Patrick Koschella
Simple C program, but cannot give expected result
wish help you to fix your issue You don't need on your printf. If you do so, you will get the address and not the value. To fix that just:
TAG :c
Date : September 07 2020, 07:00 AM , By : Sanjaya Jay
String in c "Hello world"?
Does that help I dont understand how the word "word" is printed in line 5. Can somebody explain to me? , So, step-by-step:
TAG :c
Date : September 07 2020, 05:00 AM , By : user6098208
What is void (*pfunc[3])()?
I think the issue was by ths following , I have this code line in my code. what is void (*pfunc[3])() ? , The code snippet does not make sense.This
TAG :c
Date : September 07 2020, 02:00 AM , By : Robin McLaut
C Programming Malloc is not doing right
I hope this helps . As mentioned in the comments above, C is not a "bound-checking" language (if this is what you need, there are many alternatives to choose from, ranging from D, to Nim, which can also be easily mixed with pure ANSI C).Now, back to
TAG :c
Date : September 06 2020, 08:00 PM , By : chankee
Angle math, normalize to [-180,180] and mod vs remainder()
it should still fix some issue Taken from cppreference:
TAG :c
Date : September 06 2020, 01:00 PM , By : Ramazan Oz
How can I reliably make send(2) do a short send?
fixed the issue. Will look into that further send(2) takes a buffer and a buffer length. It can return either an error, or some number of bytes successfully sent up to the size of the buffer length. In some cases, send will send fewer than the number
TAG :c
Date : September 06 2020, 08:00 AM , By : Rehana Baloch
.Exe file won't execute correctly
wish help you to fix your issue As it was said, the program exits immediatly after it's completion. If you want to run the program, executing it by double click, you can place a pause condition in the program, for instance if you put getchar(); just
TAG :c
Date : September 05 2020, 11:00 PM , By : Shubham Jain
Defining a type-checking containerof macro without using compiler extensions
Hope that helps The following is the quick and easy way to define the containerof macro, using only standard C features: , I've come up with the following definition:
TAG :c
Date : September 05 2020, 09:00 PM , By : Syron Zambas Eborda
If statement bodycnot being executed in C
I hope this helps you . tolower returns the new value.It does not modify the value in-place.
TAG :c
Date : September 05 2020, 04:00 PM , By : P Fearns
How to scan a file with string line by line and store them into linked list ADT?
With these it helps Solution: Allocate new memory to store the word when creating the Node
TAG :c
Date : September 05 2020, 10:00 AM , By : amol
C code compiles only when I include .c file
it should still fix some issue You can't declare a variable or field as a struct without having the defined the struct first. That's because the compiler needs to know its size (and the offsets of the fields, if you use those), and that requires the
TAG :c
Date : September 04 2020, 11:00 PM , By : Nicu Buga
strtok c multiple chars as one delimiter
it should still fix some issue No, according to the manual page for strtok():
TAG :c
Date : September 04 2020, 01:00 PM , By : user6098680
Use of SLLI for accessing array elements in loop
To fix the issue you can do I don't understand why he used the shift left by immediate (slli)
TAG :c
Date : September 04 2020, 03:00 AM , By : ลูกจัน ฟินเวอร์
Embedding any file into gcc compiled program and accessing it inside program
should help you out Having gone to read the article (which shouldn't be necessary; your question should stand on its own), it is not clear to me how the arrays are determined. The article uses
TAG :c
Date : September 04 2020, 02:00 AM , By : Brandon Kempster
Where can I find the source code for pcap dump?
will be helpful for those in need Looks like it's from LIBPCAP library by "The Tcpdump Group". Sources of pcap_dump are here on Github.
TAG :c
Date : September 04 2020, 02:00 AM , By : Hoàng Văn Nhã
Why two identical pointers do not compare equal with -O1?
help you fix your problem , What is the correct behavior in this case?
TAG :c
Date : September 03 2020, 04:00 PM , By : William McCluskey
All outputs end up the same in C
it should still fix some issue Assigning strings doesn't make copies, it just assigns a pointer to the same string. So key, upper, lower, and argv[1] are all the same string. When you make a change to one of them, it affects all of them.You need to m
TAG :c
Date : September 03 2020, 06:00 AM , By : ilk
What will be the output of following snippet? And why?
Hope that helps If you had just taken the effort to compile and run, you probably would have seen nothing.That's because:
TAG :c
Date : September 02 2020, 06:00 PM , By : MDS236
How to find out witch thead using specific file descriptor with C
To fix this issue File descriptors are part of the process. And since a file descriptor is just a nonnegative integer, and can be used by all threads of the same processes without explicit rebinding, asking "which thread holds an fd" is not a questio
TAG :c
Date : September 02 2020, 03:00 PM , By : Skillet93
Dictionary in C
this one helps. I'm trying to implement a pretty simple Dictionary in C. I was thinking about using a linked list. [...] Is it considered a good implementation code for a Dictionary?
TAG :c
Date : September 02 2020, 12:00 PM , By : opp
NUL termination - is it always required?
may help you . No, NUL termination is not always required.The null character '\0' is needed for strings, not in general for character arrays.
TAG :c
Date : September 02 2020, 04:00 AM , By : Bronislav Fisherman
Error: (FILE *) 'fp' was not declared in this scope
this will help You declare the file inside the if statement. As soon as you leave that scope, the declaration is lost. You should make the declaration before the if statement
TAG :c
Date : September 02 2020, 03:00 AM , By : dinesh

shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk