19,876 Topics

Member Avatar for
Member Avatar for lehe

Hi, I am sorting an double array, using qsort() #include<stdio.h> #include<stdlib.h> ... int compar( const void *arg1, const void *arg2 ) { return ( * ( double **) arg1 >= * (double** ) arg2 ); } .... int main(int argc,char *argv[]){ ... qsort(array, size_ct,sizeof(double),compar); ... } It turns out that …

Member Avatar for ArkM
0
90
Member Avatar for Dewey1040

I understand the algorithm SelectionSort, but once again my problem is the easy part( i think the college life is affecting my mind ). How in the world do you read in an unknown number of ints from a file? I thought i did it right but when i run …

Member Avatar for ArkM
0
97
Member Avatar for Bleek

hey... im in a c++ class at school but i also program at home. my teacher refuses to teach me graphics and i wanted to know if there was an easy way to just basically cout a graphic. if this is noobish and i need to learn a lot more …

Member Avatar for Manutebecker
0
395
Member Avatar for jbody

There is something that I saw and wanted to check if it is really wrong, as I thought. In the second edition of The C Programming Language 2nd ED by Brian Kernighan and Denis Ritchie, in the section of 5.2 Complicated Declarations, in page 109, it is written so, isn't …

Member Avatar for ArkM
0
119
Member Avatar for Dewey1040

I know there are multiple threads on Matrix Multiplication but all of them are either different from what i need, or are unanswered. I am trying to multiply two N x N matrices. The two matrices and N are all found in a file via argv[1]. I have spent hours …

Member Avatar for Dewey1040
0
151
Member Avatar for vishalsingwall

Hi, This is urgent if any one could please help me resolve the stated issue....... I know how to create cursors in ProC* and how to manipulate them. But I have to do it with a combination of C and MySql. Can any one guide me as to how the …

Member Avatar for Salem
0
137
Member Avatar for Dewey1040

I have searched google and the forums here and I couldn't find what i need, if there is a thread somewhere just forward me to it. I am attempting to create a program that will prompt a user for a string. The program will not recognize this string to be …

Member Avatar for Dewey1040
0
206
Member Avatar for blazen

Here is a simple substring type function that I wrote in C. [code=c] char *substr(char arr[], int pos1, int pos2) { char str[100]; char *sub; for (int i = 0; i <= (pos2 - pos1); i++) { str[i] = arr[i+pos1]; } sub = str; printf("Sub: %s\n", sub); // debugging purposes …

Member Avatar for ArkM
0
138
Member Avatar for Demonisya

Hello..... I want to ask you something..... My teacher gave us our final exam last October 16 & 17.... I want to ask you about this question: Create a program that could show this output * *** **** ****** using while or for..... what I put in my answer sheet …

Member Avatar for Demonisya
0
174
Member Avatar for T'Scoopz

I'm trying to make a linked list, what's wrong with my syntax for adding a node? [code=c] struct data { char name[20]; char number[10]; }; typedef struct node { struct data list; struct node* next; } Node; Node *head = 0; Node *tail = 0; Node *New = 0; void …

Member Avatar for William Hemsworth
0
93
Member Avatar for Susan90

Hey guys :) After a year of c++, teacher's announced we'll be learning C standard as well, starting with next semester. So anyway, I've been looking through some examples and exercises in a book and found 2 problems I can't seem to solve. (At least not in C). The first …

Member Avatar for Susan90
0
158
Member Avatar for vskumar19
Member Avatar for serkan sendur

hi, i need to create a c shared library on unix platform using korn shell. can you provide me with some sample codes please. thanks

Member Avatar for serkan sendur
0
131
Member Avatar for IT_Techno

hi, ihave this code in c# for crating cookies : if (saveInCokies_CheckBox.Checked) { HttpCookie myCookie = new HttpCookie("AtterehWebCookies"); myCookie["userName"] = userName_TextBox.Text.Trim(); myCookie["password"] = password_TextBox.Text.Trim(); if(employee_RadioButton.Checked) myCookie["loginType"] = "employee"; else if(lawyer_RadioButton.Checked) myCookie["loginType"] = "lawyer"; else if(customer_RadioButton.Checked) myCookie["loginType"] = "customer"; Response.Cookies.Clear(); Response.Cookies.Add(myCookie); Response.Cookies["AtterehWebCookies"].Expires = DateTime.Now.AddDays(30); } after that i want to read …

Member Avatar for LizR
0
124
Member Avatar for Clockowl

EDIT for moderators: Yes that "one might think that swapbuffer is slow" was me. Heh. :D Could someone change the topicname to "Optimizing OpenGL"? Thanks. Hey guys, I'm trying to optimize this OpenGL program, so the problem isn't C, but the program is. The program loads a vanilla WaveFront .obj …

Member Avatar for veelck
0
1K
Member Avatar for RenjithVR

Hi All, Can anyone tell me about a library that helps me to read contents from /etc/resolv.conf file and also update the same file with new entries. Does this possible with Resolver library routines? Any useful links or sample programs regarding this? Thanks in advance. Renjith

Member Avatar for stephen84s
0
196
Member Avatar for java_girl

Hi. This is NOT a homework assignment (self-interest only). The exercise asks me to write a function which accepts two strings and returns a pointer to the longer of the two. [code language="C"] #include <stdio.h> #include <stdlib.h> char* longer( char str1[], char str2[] ); char* str_ptr; int main( void ) …

Member Avatar for devnar
0
11K
Member Avatar for yingfo

Hi I was wondering if anyone could help I'm receiving a segmentation fault whenever I go to run my main.cpp on my program. I've never encountered this before and was wondering if anyone knew how it can be fixed. The program consist of equiv.h, equiv.cpp, graph.h, graph.cpp, and main.cpp here …

Member Avatar for yingfo
1
260
Member Avatar for slimjimmer

Hi, In this piece of code in my program I am receiving the following error request for member âyâ in something not a structure or union. [code=c]struct intpair { int x ; int y ; } ; struct intpair makeintpair(int x, int y) { struct intpair temp ; temp.x = …

Member Avatar for Luckychap
0
100
Member Avatar for raja289

i am designing a code that will calculate tomorrows date but there is some problem with the code, when i enter year = 2008 or anyother month =12 day = 31 it gives tmorrows date as 1/2/2008 please help and tell me if i can do more improvements thanks [CODE]#include<conio.h> …

Member Avatar for devnar
0
120
Member Avatar for manojn1979

Hello [B]How to send a file from server to client. [/B] I am a bigger in C with unix, i am trying to read a file from server and display it in client , i got a separate code to read a file , and i tried to connect the …

Member Avatar for manojn1979
0
156
Member Avatar for rlp1938

I need to be able to calculate the size in pixels of a given piece of text from the font name and point size. Google has not turned up anything I can use as yet (or maybe understand). Clues anyone? Bob

Member Avatar for d0pedup
0
226
Member Avatar for complete

After someone creates a DLL in C# using the Microsoft Visual development environment, how would another programmer take that code, make a new project that includes the DLL's source and make a GUI that uses the DLL'S API?

Member Avatar for dickersonka
0
136
Member Avatar for Erikmmp

Hi I'm pretty new to C (about a week experience) and I was wondering if C had anything like Python's random.choice() function. Basically it just selected a random element from what you gave it, a number from an array or a character from a string. If there is no function …

Member Avatar for Erikmmp
0
125
Member Avatar for java_girl

Hi. I recently read that using the name of an array without brackets was one method for accessing the <address> of the array's first element. E.g: [code=c] #include <stdio.h> int arr[5] = { 2, 4, 6, 8, 10 }; int main( void ) { printf( "The address of the '2' …

Member Avatar for Luckychap
0
235
Member Avatar for riahc3

Is there a good webpage that explains how to use rand() and srand() correctly? Overall I need to learn how to generate a number between 0 and 3.

Member Avatar for Narue
0
222
Member Avatar for ahspats

i have to write a program that deletes special characters from a phone number. For Example: (0049)5599/85675-344 0049559985675344 i have started to program it, but it doesn't seem to function. here's my code: [CODE] #include <stdio.h> void affe(char nummer[]){ int n , i, z; n = strlen(nummer) - 1; for …

Member Avatar for ahspats
0
125
Member Avatar for serkan sendur
Member Avatar for serkan sendur
0
72
Member Avatar for syphon_hawk

I need help with errors I am getting with my program that is suppose to take in lines of text and out put the number of letters to the user. I have a lot these errors [QUOTE]expected primary-expression before ' ' token[/QUOTE]

Member Avatar for syphon_hawk
0
184
Member Avatar for Church

i'm trying to put a function call inside of a function call: [CODE]switch_statement(menu());[/CODE] switch_statement is a function call and so is menu. I want what menu is returning to go into switch_statement but i kinda don't want to bother making a new variable just for this task.. So is it …

0
91
Member Avatar for chchiu
Member Avatar for mrboolf
0
128
Member Avatar for Creator07

Hello, I'm still a C beginner. I am trying to make a simple code for searching a string in a doc file. I want to search for a name in the "Employee Database", and display the employee data no,name,desgnation,reg no.,Projects worked. The template in the file is as follows: [CODE]Employee …

Member Avatar for devnar
0
109
Member Avatar for LightSystem

Hi. Im working on a project with a relative size and Ive run into a deadlock, I need some advice in how to proceed. I have a server that creates multiple threads to handle its clients, but each thread must serve a client multiple times, here is the thread handling …

Member Avatar for LightSystem
0
89
Member Avatar for latour1972

can someone help me for this cuz I dont know what to do [code=c] #include<stdio.h> #include<math.h> /**RLC Circuit**/ void main() { float v, r, l, c, f, i; long double Xc, Xl, Z, Vr, Vc, Vl; const double pi=3.1415926535; printf("Enter v="); scanf("%d",&v); printf("Enter r="); scanf("%d",&r); printf("Enter l="); scanf("%d",&l); printf("Enter c="); …

Member Avatar for Creator07
0
2K
Member Avatar for IrishUpstart

So I got this question where we are given a data (txt) file. We need to read it into an array, then report the first, fifth, and last entries of that file. Here is the code that I have thus far. It's reading the first, but the other two are …

Member Avatar for devnar
0
93
Member Avatar for atman

hello., im trying to create a validation block that checks if the number is multiple of 5. im new at c, could anyone give me a tip? thanx a lot! cheers!

Member Avatar for grumpier
0
89
Member Avatar for JCasso

Hi, I am programming a pos terminal by using C Programming language. I cannot use strtod() or atof (since it just calls strtod in it). Any advices on converting string to double without using these functions? Thanks in advance.

Member Avatar for ArkM
0
1K
Member Avatar for OutOfReach

Hey all, I am a C beginner. My problem with my code is that I get a segfault. Here's my code [CODE=C] #include <stdio.h> struct studentInfo { int totalClasses; float GPA; char studentName[41]; }; main() { int numOfStudents, i; printf("How many students would you like to take account of? "); …

Member Avatar for OutOfReach
0
120
Member Avatar for aamresh1

Can anybody please let me know the command to link two C files in Linux platform during compilation. Thanks, Amresh

Member Avatar for Salem
0
53
Member Avatar for LightSystem

Hello, I need some urgent help, I have a program that communicates with another program. Its basically a Q&A, where one side introduces a question and the other answers it. And yes this is a school work, and it needs to be delivered soon. Im posting here because Im quite …

Member Avatar for dreaddoC
0
91
Member Avatar for Mitchapalooza

Okay, to start off my system is kind of an experiment on how well a dual hard-drive system performs differently from a single hard drive system. I have a 35 Gb drive that i placed windows vista 64bit on. Now the drive runs at 10k. Opposite that hd i have …

Member Avatar for jbennet
0
143
Member Avatar for aamresh1

We tried compiling a code - multiply1.c in the Linux environment by giving the command gcc multiply1.c (we have renamed it) but its throwing errors like :- In function "main": undefined reference to '_gmpz_init_set_str' We are getting 6 to 7 this type of errors. Can you please let us know …

Member Avatar for aamresh1
0
167
Member Avatar for slimjimmer

Hi I'm trying to implement malloc into the following file but I am having some difficulty grasping the concept. My code: [code=c] #include <stdio.h> #include <stdlib.h> #include <string.h> #define HALF_PI 1.570639 #define EXPECTED_ARGS 2 #define LOWER_LIMIT 0 float Integrate (float upper_limit, float x[2][10000], float fx[2][10000]); int main (int argc, char* …

Member Avatar for slimjimmer
0
154
Member Avatar for flarn2006

I want to know how to read the status of my laptop lid in a Win32 C program. I don't want to use any libraries, not even MFC or .NET. Thanks in advance?

0
46
Member Avatar for LightSystem

Im trying to understand why a simple function I wrote doesnt work as it should, its probably some simple noob mistake, but its really making no sense. Here it is: [CODE=C] void justapoe(char seq[], int pos){ char c; int i; printf("Insert: "); scanf("%c", &c); seq[pos]=c; printf("Seq: "); for(i=10;i<50;i++){ printf("%c", seq[i]); …

Member Avatar for jephthah
0
92
Member Avatar for dusse

Hello guys, How can I read and write in the same file? I want to open a file that exists and write something in the end of each line of the file.. Ex: My_file: a b c d e f g h i I want to alter to: a b …

Member Avatar for Salem
0
90
Member Avatar for atman

Hey guys! Could anyone enlighten me how to draw a graphic window in c? which classes to use and maybe a basic example would be greatly appreciated. cheers!! im using XCode and i assume it doesnt have all the libs like Borland, or Visual studio... cheers!

Member Avatar for Ancient Dragon
0
63
Member Avatar for sambafriends

when I did the following porgram I got the error like NewNamespace.Focusview does not implement interfaceNenamesapce.Iencrypt.Icompress why? can any body explain this problem [code=asp.net]using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NewNamespace { interface IEncrypt { void IEencrypt(); void Idecrypt(); } interface Icompress { void compress(); void decompress(); } …

Member Avatar for Fungus1487
0
103
Member Avatar for patkhor

Hi, I found this code for shuffle one-dimensional int array somewhere: [CODE]void shuffle(int *array, size_t n) { if (n > 1) { size_t i; for (i = 0; i < n - 1; i++) { size_t j = i + rand() / (RAND_MAX / (n - i) + 1); int …

Member Avatar for Salem
0
114
Member Avatar for AcidG3rm5

I have the following in a text file How old are you?:I am 1 year old. Basically, the ":" is the delimiter. "How old are you?" is the question and "I am 1 year old" is what i will reply when i get the question . There is basically 2 …

Member Avatar for Salem
0
118

The End.