- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 11
- Posts with Upvotes
- 10
- Upvoting Members
- 10
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- ProgrammingTVDay Dreaming
- PC Specs
- Fedora Core, OpenSuse 11.3, RHELIntel i5,4GB RAM, 360GB HDD, 1GB Graphics
64 Posted Topics
Re: [QUOTE=murtazamzk;1390690]Hello guys this is an amazing programming that converts entered digit into word.nut i need your help i am only able to do it upto 99. [B]#include<stdio.h> #include<conio.h> void main() { int n,m,j; clrscr(); printf("Enter any number between 1 to 99 : "); scanf("%d",&n); printf("You entered "); if(n>0&&n<=10) goto one; … | |
Hi Guys, I have a USB disk with ext3 file system created in linux. I want to re format it to FAT16 somehow. I dont have a linux system but have only a windows xp machine. Please help me to do it. Thanks. | |
Where is the location for temporary files of Firefox in Windows xp. I am asking for latest versions of firefox( 5.0 or higher) | |
Hi My network has a proxy server installed. I need to go through that server for internet connection. In my windows xp machine,I get internet connection through IE. But firefox and chrome doesnt work. The IE setting for proxy says, automatically detect the settings. But with the same option for … | |
Re: Displaying the stack completely is complicated but anyway, it is possible to display the call stack completely. If you are interested in that go through this link [URL="http://www.linuxjournal.com/article/6391"]http://www.linuxjournal.com/article/6391[/URL] | |
Re: "C programmer use this kind of code where a int pointer has been declared first and assigned a value inside a function? " These kind of programming is employed widely in embedded systems where a memory manager gives a memory and applications use it to fill it somewhere else. | |
Re: [QUOTE=WaltP;1439562]Don't call [iCODE]main()[/iCODE] from your functions. [iCODE]return[/iCODE] instead.[/QUOTE] Just out of curiosity, Why did you say this? @Waltp | |
Re: [QUOTE=l1ttledb;1429906]K guys, the function is good now thanks.. any ideas why it won't return the char? [CODE] { char choice; printf(" Would you like the data sorted, Y or N:"); scanf(" %c", &choice); return choice; }[/CODE][/QUOTE] scanf(" %c",&choice) -> You have put a space infront of %c. that could be … | |
Re: [QUOTE=Benkyou;1429222]Ok, going to check it out. Thanks. Off topic: i think its yours, [url]http://eternallyconfuzzled.com/[/url]. Used this site to study hash functions and hash tables. Very well written, can't thank you enough.[/QUOTE] Oh Is it? I use that to study datastructures.. Whoever is the Author, I am greatly thankful to him/her.... | |
Re: [QUOTE=shinsengumi;1394049]I didn't mark it as SOLVED yet because I thought I would still be asking something about multithreading, but it seems like my program is headed to another route (which is to use socket programming). I'm new to socket programming so I'm not really sure which protocol I'm going to … | |
Re: [QUOTE=onus;1393949]I am trying to understand usage of keyword __attribute in C I have checked following two pages [url]http://unixwiz.net/techtips/gnu-c-attributes.html[/url] and this page also [url]http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html[/url] but still I could not understand where do I declare them and how I can use __attribute in my program. To test this I wrote a C … | |
Re: [QUOTE=iarkey;1393222][CODE]#include <stdio.h> #include <windows.h> #include <stdlib.h> DWORD WINAPI test_thread(LPVOID lpParam) { printf("thread whiiiii\n"); struct person { char *namee; int agee; }; struct person p = ((struct person)lpParam; printf("%s\n",p.agee); ExitThread(0); } int main() { struct person { char *name; int age; }; DWORD thread; struct person p; p.name = "John Smith"; … | |
Re: [QUOTE=bufospro;1393312]It's problem from the server's compiler you said. I tried hello world program and the same message appears. Thanks a lot for our help[/QUOTE] Which compiler are you using? Can you paste the Command used to compile your code here? | |
Re: [QUOTE=atramposch;1389992]I dont get any errors, it should correctly write out to this file and if the file doesn't exist it should create it. (Or i believe thats how it works) But in console i get this error Running… Program received signal: “EXC_BAD_ACCESS”. sharedlibrary apply-load-rules all (gdb) I re-wrote to include … | |
Re: [QUOTE=Perry31;1389681]Hi, Can anyone explain in detail what is the difference between int *a and int* a? Is there any difference between them?[/QUOTE] No difference.. But it is better do it 'int *a;' because of readability and is more understandable. Eg: Suppose the statement is [CODE]int* a, b;[/CODE] it is actually … | |
Re: [QUOTE=gerard4143;1387508]To see what's just do some substitution... #define TBASE_DEFERRABLE_FLAG (0x1) struct tvec_base *base First we cast base to unsigned long (unsigned long)base Then we perform the bit operation & on (unsigned long)base & 0x1 Then we cast our result to (unsigned long)(unsigned long)base & 0x1 Why do it this way? … | |
Re: [QUOTE=george_82;1389503]thanks for the reply... i just need to know *(char**)&a ...so what is the role of char** in this .I know that char* means pointer casting of 1 byte but im always confused with char**[/QUOTE] ** means pointer to a pointer char** a; means a is a pointer to a … | |
Re: [QUOTE=AspiringGuru;1389389]I absolutely hate hate hate hate HATE to be doing this, because I've figured out every other program I've done relatively alone with my C Book. I'm writing a program that declares an array of structs, each with a name and age field. The data is read from a file … | |
Re: [QUOTE=muramasa007;1388150]I'm really confused on how to call those back to main because I've already set an address in calcData.[/QUOTE] pass pointer to calcData() for whichever value is getting modified from that function. You are modifying some at calcLoan() as well. For that also, you should pass address from main to … | |
Re: [QUOTE=gina_cs;1386240]every time I try to put but t1 and t2 into the output.txt, t2 overwrites t1, HELP please[/QUOTE] #./a.out > outfile1.txt& #./a.out > outfile2.txt Note the & at the end of first command. It will run the first process in bg so that you can run the next process. Is … | |
Re: [QUOTE=jothi lakshmi;1380453]to print the elements of singly linked list[/QUOTE] printed :-O | |
I have spent some time in C forum already but I forgot to introduce myself here since I was concentrating more on solving my C issues at first... I am Sreejith Education : Graduate in Communication Engineering Working in Television domain My OS Flavour is OpenSuse 11.3 Why I am … | |
Re: [QUOTE=MarounMaroun;1375934]Thanks for your reply. But I don't think thats the problem.. I wrote on the run line the text file I want to read. I did it in another program and it works. I guess something wrong with my code. anyone?[/QUOTE] 2 chances 1. You are not passing the argument. … | |
Re: [QUOTE=bufospro;1375064][CODE]#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> int pos; typedef struct account { char fullname[40]; int id; int amount; char name[15]; } account; typedef struct parking_system { int pos; char name[15]; char description[80]; float price; int busy_lots; account allaccounts[5]; int id; } parking_system; parking_system *myaccounts; int create(int socket) { … | |
Re: [QUOTE=aplh_ucsc;1376079]hey guys! I need to know how to use pthreads with mutex to protect the critical section!![/QUOTE] read [URL="http://www.cs.cf.ac.uk/Dave/C/node31.html#SECTION003100000000000000000"]this[/URL] | |
Re: [QUOTE=SpyrosMet;1375387]Hi everyone. i have an issue with a server program i'm developing for a university project. The issue is the following: The server program i'm building uses shared memory and forks. However i have a problem as to how can i destroy the shared memory segments i've created. A simplified … | |
Re: [QUOTE=yuri1969;1375321]My func looks like: [CODE]int pop(node **hd, char **new_element) { node *dummy; int i = 0; if (empty(*hd) == 1) { printf("Stack is empty"); return -1; } else { (*new_element)[i] = (*hd)->element[i]; // problem is here ;) dummy = *hd; *hd = (*hd)->next; free(dummy); }[/CODE] and I call it via: … | |
Re: Adding to above post, [code] Student[i].regNo.campus == "KUALA LUMPUR" [/code] This wont work. Use the function strcmp, if campus is a string | |
Re: [QUOTE=myk45;1361227]@roottybrian Well, i was talking about a singly linked list.[/QUOTE] [URL="http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_linklist.aspx"]this[/URL] could be a good read | |
Re: [QUOTE=Narue;1357356]Wow. While I'm sure this isn't a record, one lazy student asking for "help"[1] on an assignment followed immediately by another lazy student hijacking the thread asking for "help" on an unrelated assignment is a wonderful example of the present progression toward the fall of Daniweb. [1] "Help", of course, … | |
Re: [QUOTE=KJLakshmi;1357257]Allocation, reallocation and free is done in the some libray module. Same code is working fine in release mode.[/QUOTE] Have you made sure that your memory is not released somewhere else before realloc() call? Have you done proper return checks of re alloc? Are you able to see the values … | |
Any suggestions on the best online tutorial/ebook/printed book regarding C libraries and latest c std? I would like to get more coverage on FILE I/O s Thanks in advance | |
Re: [QUOTE=N1GHTS;1344417]I have a weird problem and I want to know if any of you have any ideas on how to fix this. If I do this... [code] swprintf(Dest, 500, L"G%sY", "AMEDA"); [/code] [b](wchar_t*)Dest[/b] contains the following text... [TEX]GAMEDAY[/TEX] But if I do this... [code] swprintf(Dest, 500, L"G%sY", L"AMEDA"); [/code] [b](wchar_t*)Dest[/b] … | |
Re: [QUOTE=prasanthsagar;1343972]I have an array with some integers. i want to remove redudants integers in the array and print the integers without redudancy... can any one give me the code please.....[/QUOTE] Your answer is here.. last point in this thread [url]http://www.daniweb.com/forums/thread78060.html[/url] | |
Re: [QUOTE=Narue;1341878][B]>Umm... well I guess I'll just agree with you and let it be.[/B] ...I see I wasted my time trying to teach you. Next time I'll just say you're wrong and not bother explaining why unless someone who's [I]willing[/I] to learn asks.[/QUOTE] I was curiously watching this discussion. I understood … | |
Re: [QUOTE=Dazaa;1340778]Hi, I usually use C++, but I am working with some very old code and need to do it in C. So i understand malloc is used char *p; p = malloc(200); where 200 is the amount of bytes I need. and yes i know I need to use free. … | |
Re: [QUOTE=N1GHTS;1339536]I usually don't even bother with the C array's. I go straight to the point and access the array's member directly. That way I make my own rules to how I index my array. Many situations call for many types of arrays, and I find the C array a bit … | |
Re: [QUOTE=nidhik;1340523]can a file other than a .h file be included with #include[/QUOTE] Answer : Yes :) Any file can be included using #include.. #include just inserts the contents of that file in your C program. | |
Re: [QUOTE=devel2000;1340419][CODE]>"C:\Program Files\gcc\bin/g++" -Os -mconsole -g me.c -o me.exe me.c:11: error: expected initializer before ')' token me.c: In function `int binary_decimal()': me.c:78: warning: converting to `int' from `double' me.c: In function `int testnumber()': me.c:104: error: `isdigit' was not declared in this scope >Exit code: 1 [/CODE][/QUOTE] Just Post your code also … | |
Re: [QUOTE=Auraomega;1340040]Just wondering how I can get the time the program was compiled into my code dynamically, I'm guessing it'll be through my makefile somehow but my Google-fu has failed today. Any help would be great! (GCC + make *only*)[/QUOTE] I dont know whether i understood your question correctly. Still this … | |
Re: i dont really understand whats going on here [the question itself].. so I am adding myself, So if i had missed something i will get it by the time it gets solved @OP or Narue , one doubt whats the function Cmd_ExecuteString() doing? I was not able to make out … | |
Re: [QUOTE=Rastabot;1337462]Hello, I'm trying to make a program that will multiply 2 matrices using shmget() and fork(). For example, I would need to multiply a 64 x 64 matrix using 4 processes or 16 processes, and the multi-processes will be created using fork. Each process will calculate a partition of the … | |
Re: [QUOTE=Ancient Dragon;1335168]If you have already been working on it, where is the pseudocode or c++ code that you have written?[/QUOTE] HI AD, i think you again forgot that this is a c forum :) | |
Re: [QUOTE=rapids79;1333403]I am trying to write a function that calculates the sine of a given angle. The code works fine if the angle in degrees is less than 100...once the angle becomes greater than 100..the result is a large value. I don't know what I am doing wrong. Can someone point … | |
Re: [QUOTE=Ancient Dragon;1333843]Why are you using low-level file i/o?? Just use FILE* and all will be ok. The only reason to use open() is when the compiler for the target operating system doesn't have FILE* and associated functions. But to answer your question, [URL="http://www.opengroup.org/onlinepubs/009695399/functions/lseek.html"]lseek[/URL]() returns the file offset.[/QUOTE] Although this question … | |
Re: [QUOTE=N1GHTS;1333690]I will admit that I don't completely know my way around the NetBeans IDE as well as I should. This is the only meaningful line of code in the [b]"Build"[/b] tab right before the error shows up: [code] gcc -c -g -I/usr/include/freetype2/freetype -I/usr/include/freetype2 -I/usr/local/include/SDL -I../shared -MMD -MP -MF build/Debug/GNU-Linux-x86/_ext/819228780/iString.o.d -o … | |
Re: Tried in RHEL Got 27 for parent instead of 26 in your output .. :-O In fork When creating a process, in fork() the child takes the duplicate of the memory space from parent.. So the address of &fp need not be same but fp is same. Then I used … | |
Re: [QUOTE=challarao;1331824]Thanks.. But what are man pages ....Do you mean header files I checked string.h file for strrev().There is no such function in that file.If man page is not header file what is that..? Is there any predefined strrev() equivalent in GCC..C? What do you mean by implement...Do I need to … | |
Re: just to elaborate on the above reply, [code] char *acName="hello daniweb";[/code] acName points to an address of a string . that string is a seperate entity and the "hello daniweb" is stored in a Read Only Memory So when you try to change the memory location by doing [code] *acName='H'; … | |
Re: [QUOTE=bnickerson;1328614]Thanks but I am error checking to see if the file opens or not. Here is my code for one of the functions..ignore the extra printfs - they're there to help me keep track of whats happening: [CODE] int Parse_request(int new_fd){ FILE *fread; FILE *sendFile; char request_page[MAX_MSG]; char send_buffer[MAX_LEN]; struct … |
The End.