19,876 Topics

Member Avatar for
Member Avatar for niroop
Member Avatar for TotoTitus
0
82
Member Avatar for TotoTitus

Hello everyone, i'm fresh new here, and i already have a question regarding...well, C#. I've made a Forms Application in which the user submits an image (bmp,png,jpg or gif), and the image suffers some byte-level modifications (obviously, i'm using the LockBits() method). Now, after the modifications are done, the user …

Member Avatar for TotoTitus
0
10K
Member Avatar for matthewl

hello I am trying to create an robot and I have been having a problem parsing the full string from the conf. As example the IRCServer, botnick, botname parameter does not contain the all the data. as the output shows: [code=output] ##################### # Ablaze Bot # ##################### Loading conf file: …

Member Avatar for matthewl
0
139
Member Avatar for dennis.d.elston

HI everyone, I am new the world of C and am having some problems with a class assignment. Can anyone help? [CODE] #include <stdio.h> #include <math.h> #include <string.h> #define Max_sites 10 /* maximum number of sites allowed */ typedef struct { int site_id_num[4]; /* id number of the site */ …

Member Avatar for dennis.d.elston
0
111
Member Avatar for suman holani

Hi , I am writting an c++ boost shared memory application. The string/char class works fine . But the allocation to int phases some problem. It works fine for a while bt suddenly shared memory crashes. Unable to access it. here is a small snippet. we have to create a …

0
60
Member Avatar for Iwillpassc

Hi guys, I have a real quick problem, or at least I hope it's really quick. The thing is, I'm studying for a computing C final, and one of the sample questions requires me to take data from a file, put it in a linked list, and then place it …

Member Avatar for kamiyo
0
195
Member Avatar for Champhero

plz help me out to make a program in C. I want someone to tell me that how to make a program of parking slot in which car r entering and leaving...........??????

Member Avatar for WaltP
-4
75
Member Avatar for anthonytan

[CODE]#include <stdio.h> #include <ctype.h> int mygetd(double *result){ char c, buff [ 32 ]; return fgets(buff, sizeof buff, stdin) && !isspace(*buff) && sscanf(buff, "%lf%c", result, &c) == 2 && (c == '\n' || c == '\0');} int main(void){ double value; do { fputs("Enter a floating-point number: ", stdout); fflush(stdout); } while …

Member Avatar for WaltP
0
76
Member Avatar for basedon

First off, I'm new to C++. I'm taking an intro class at university and have discovered something odd after installing Visual Basic 2008 Express on my laptop. Here's what I'm doing: New Project --> Win 32 Console --> Empty --> Add New item --> C++ File In my new C++ …

Member Avatar for jonsca
0
194
Member Avatar for MAV_DevWantaB

Salutations All,,, Just looking for some input on this C program..:?: I believe it is working correctly but I think I have my Understanding of bits backWards....... :hair: AnyWho - The program should input a value from user and call the reversebit function to print the bits in both original …

Member Avatar for MAV_DevWantaB
0
220
Member Avatar for kirennian

Current setup - One single core graphics device, Two monitors. As the title would suggest, I'm currently attempting to create an application in c++/DirectX which supports a theoretically uncapped limit on the number of full screen view points in the program. I'm utilising swap chains for each display and worthy …

0
63
Member Avatar for spookytr

a. Implement an iterative function that takes an array of integers and the size of the array, and returns the sum of the contents of the array. b. Modify your function as to be defined in a recursive manner. c. In order to test your functions, implement a program with …

Member Avatar for spookytr
0
115
Member Avatar for malaks123

plss help me ......make a c program that will input two words and determine if they are anagram or not anagram if the same words they are identical.............this is my code but its not complete plss help me......... [CODE] # include <stdio.h> # include <conio.h> # include <string.h> int main(){ …

Member Avatar for Ancient Dragon
0
106
Member Avatar for enterhellozia

is it possible to have a generic stack which works for all the primitive and non primitive data types???? Sir this is very serious question because this is confusing me a lot look at the code of push method of the integer stack [CODE] void Stack::push(int number) { Node* newNode=new …

Member Avatar for Narue
0
134
Member Avatar for kratoz

Hello, First of all, im a total newbie at c++ so please , dont be amused. My question is, how can i make a application that needs a user and pass. from a already existing website in order to continue?

0
44
Member Avatar for johndoe444

hi, [CODE] if (CLIENT_HANDLER_THREAD_CREATION_POLICY == POLICY_PRE_CREATE) { int id[NUMTHREADS]; for (int i = 0;i < NUMTHREADS;i++) { int id = i; int status = pthread_create(&client_request_handler_threads[i], NULL, handle_client_requests, &id[i]); } } void* handle_client_requests(void* id) { //printf("server threads spawnd\n"); // create log file thread_id = pthread_self(); sprintf(log_file_name,"t%d.log",thread_id); log_file = fopen(log_file_name, "w"); // …

Member Avatar for ithelp
0
99
Member Avatar for staufa

I've been trying to read characters from the keyboard using 'getchar()' but my code always misses one character. Can anyone tell me why this is [CODE=suntax]#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char string[50]; int i; printf("Enter a string: "); for (i=0; i < strlen(string); …

Member Avatar for cthoes
0
327
Member Avatar for vibe0405

I am trying to build an address book program. It has two options so far, it reads the addresses and prints them. they are accessible through a menu in the main function. Everything works fine but for the address I need more than 1 word, separated by space, so I …

Member Avatar for cthoes
0
2K
Member Avatar for rt.arti

Hello, I am working on a network design problem (min-cost flow) to find the shortest paths for every set of start and destination nodes. Based on the set of inputs (arcs--(which are of the form (start,end) ) and cost) the program calculates the minimum cost from the start to destination …

Member Avatar for Dave Sinkula
0
96
Member Avatar for The-IT

Hello, I started learning C yesterday, I came here with lots of experience in python scripting. I created a script that uses a variable in a for-loop, that was defined before the loop its self. I get this error: [code]skilz.c: In function ‘main’: skilz.c:16: error: ‘prog’ undeclared (first use in …

Member Avatar for Dave Sinkula
0
143
Member Avatar for cthoes

below two are same program except i interchange to accept input value ....in the first program i accept first using scanf and the by getchar()...which didnt allow to accept character value . but in the second program i first accept getchar()value and then scanf(). so it works fine but i …

Member Avatar for cthoes
0
101
Member Avatar for johndoe444

hi, [CODE]#include <stdio.h> int* get_int() { int arr[100]; arr[0] = 5; printf("arr %p\n",arr); return arr; } int main() { int* p = get_int(); printf("got %p\n",p); return 0; }[/CODE] for the code above I get this warning message: [CODE]test-heap.c: In function ‘int* get_int()’: test-heap.c:5: warning: address of local variable ‘arr’ returned …

Member Avatar for gerard4143
0
265
Member Avatar for BestJewSinceJC

I'm wondering where to find what values system() accepts. For example, I want to list the server's OS type. I already did man system, did not find it very useful. And google is returning a lot but nothing relevant.

Member Avatar for BestJewSinceJC
0
78
Member Avatar for johndoe444

Hi, For the following code segment I am getting segmentation fault: [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> char* trim(char* str) { // while consecutive ws at the beginning skip int len = strlen(str); int i = 0,j = len-1,k,l = 0; while (str[i] == ' ' || str[i] == '\t' …

Member Avatar for johndoe444
0
93
Member Avatar for johndoe444

Hi, I am trying to do meet these 2 requirements: 1. create a global file containing global variables that can be accessed from multiple places. Need this for multithreading. something like global.c/h to contain global data in particular the mutexes. 2. some list modules that is required from different other …

Member Avatar for johndoe444
0
172
Member Avatar for fenerista

The functions are like that: if I press "ctrl + h" or '*' the system will print to the logs the system time(in module programming with printk.), if I press "ctrl+ p" or '-' the system will print to the logs process list and no mattrer if I press the …

0
71
Member Avatar for Rombosia

Hi, I have a C++ dll with a header having the following struct: [CODE] struct TData { DWORD m_Command; BYTE m_Option; char m_Message[300]; }; [/CODE] The dll also has a callback function MessageReceived that takes TData as a parameter. The function fills in the m_Message with some data and returns. …

Member Avatar for selvaganapathy
0
1K
Member Avatar for cwarn23

Are there any tutorials on defining a variable so that it can be used for any type. Example the following: [CODE]int main() { var myvariable; myvariable="this is a test"; myvariable=3.141592; myvariable=myvariable*myvariable; return 0; }[/CODE] But I don't know how to make it possible to make the above code possible. It …

Member Avatar for cwarn23
0
134
Member Avatar for BestJewSinceJC

Hey guys, simple question that I don't see anything on in the String.h library and I can't remember from my C class 3 years ago. I have the following declaration: char something[100] = "whatever"; And later in the program I call strncpy. After calling strncpy, at some later point I …

Member Avatar for WaltP
0
94
Member Avatar for johndoe444

Hi, I want to write a log function but I want to implement in the style of fprintf/sprintf style. ie [CODE] fprintf(arg1, template string, template values) write_to_log(template string, some array of ints/double etc to fill the template) [/CODE] I want to implement this variadic function: [CODE] void write_to_log(char template, int …

Member Avatar for Dave Sinkula
0
114
Member Avatar for johndoe444

I have this code. I want to update the writes immediately to log file before closing the file (because my program might get hang and I have to exit it by ctrl+c so fclose would never be called). The code is: [CODE] 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 …

Member Avatar for nezachem
0
254
Member Avatar for johndoe444

Hi, In java, we can run a program remotely by doing something like this: [CODE]Runtime.exec("ssh machinename programname")[/CODE] I was wondering whether I can do the same in C using some standard library function call. Also is this possible to get a handle to the remote program's input/output to see its …

Member Avatar for gerard4143
0
95
Member Avatar for NargalaX

Hey everyone, How would I go about creating a simple chat bot? I have finally just recently got an API running for a chat application called Steam, and I can send and receive messages with this program and moderate everything that goes through, too. So, I was hoping on getting …

Member Avatar for Geschickte
0
263
Member Avatar for student1t

Hi, I am trying to search for a word I have entered into a list. I could list all entries so far. But I am having a hard time figuring out a function that can search for a particular word on the list. Below are the codes. I commented out …

Member Avatar for student1t
0
80
Member Avatar for Iam3R

Hi, i understand merge sort & quick sort even i can write the programs but iam unable to understand its complexity. its very easy to derive complexity equations for selection & bubble sort. as the code is little complex & recursive nature i am unable to understand its complexity and …

Member Avatar for Narue
0
127
Member Avatar for rwagnes

I am supposed to create a chain of N processes, where N is the command line parameter. Each process creates a child process, prints out its own PID and its parent's PID, and then waits for its child to terminate by calling the wait() function. [B]Here is my code:[/B] [code=c] …

Member Avatar for shakunni
0
240
Member Avatar for Shaikh Mohsin

Hello Friends, I want to writ a program which scan network for Operating system at boot time.plz if any known how to start writing that program in c.reference plz Thank u all

Member Avatar for Seten
0
171
Member Avatar for daeuse

So I'm working on my final project, and I decided to create a BMI calculator. As part of the requirements, I need to call a function into play. Below is what I have so far, but I am getting errors. I don't expect the solution, but could someone assist me …

Member Avatar for daeuse
0
171
Member Avatar for Hitman Mania

So I'm trying to make a program that generates twin prime numbers between 1 and 1000. I think I got it, but I can't stop the looping it goes on forever. Here's my code so far: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int a, c; a=3; …

Member Avatar for gerard4143
0
80
Member Avatar for mtfudi

Consider the following C++ program fragment: [CODE=c++]int a[1000]; int b = 0; for (int i = 0; i != 1000; i++) { b = b + a[i]; }[/CODE] (a) Write a MIPS assembly program which corresponds to this program fragment. (b) Unroll the loop in the program 4 times in …

Member Avatar for kolosick.m188
0
75
Member Avatar for nikoo718

Hi every body i need a code of program that makes a number puzzle. the puzzle has 16 pieces,that move with arrow keys. this is my project! plzzzzzzzzzzz help me!:sad:

Member Avatar for Ancient Dragon
-3
88
Member Avatar for ax8l

Hello everybody, I want to overload a function based on an array dimension or pointers. Ex: [CODE] int calc(int a[]); int calc(int a[][]); [/CODE] or [CODE] int calc(int *a); int calc(int **a); [/CODE] *a should be &a but i dont know how to face a reference of a reference so …

Member Avatar for ax8l
0
102
Member Avatar for Iam3R

[CODE] [Davis@localhost UNS]$ gcc U_bc.c [Davis@localhost UNS]$ ./a.out a=d i=100 f=0.000000 sizeof(u)=4 [Davis@localhost UNS]$ cat U_bc.c int main() { union test { char ch; float f; int i; }; //union test u={'a',21,34.65}; gives a warning excess elements union test u={100.23}; printf("a=%c i=%d f=%f\n",u.ch,u.i,u.f); printf("sizeof(u)=%d\n",sizeof(u)); return 0; } [/CODE] in the …

Member Avatar for Dave Sinkula
0
97
Member Avatar for Romil797

Hi I have tried so much and I am wondering how I can put a background image in an email using gmail.

Member Avatar for sknake
0
383
Member Avatar for redroze

hello folks, I have an array of integers and I need to search if there's a combination of 2 numbers that resault a defined sum. No loops or static variable are allowed. Any suggestions? cheers, Elad.

Member Avatar for uskok
0
154
Member Avatar for kemiko

The following is output from an unknown command off an old school DEC Ultrix machine. Does Linux have a similar command/tool? Thanks, Kent 1 pend_nonpayment: int(), <pend_nonpayment.c 79> 2 usr_pwd: <> 3 display_error: <> 4 clears: <> 5 paint: <> 6 current_date: <> 7 get_process_date: <> 8 strcpy: <> 9 …

Member Avatar for gerard4143
0
251
Member Avatar for RexxX

I've never written byte variables on my unix shell before, so I don't know if it works or not. I'd been using unsigned ints to get hex numbers as input but I was having trouble with what my input actually was. My friend told me to use byte variables instead …

Member Avatar for Narue
0
139
Member Avatar for kele1

I'm trying to change this program into a doubly linked list but i'm having a difficult time. Please help me out thank you.[CODE]#include <stdio.h> #include <stdlib.h> struct Node { char data; Node *next; Node *prev; }; //typedef struct node Node; typedef Node *NodePtr; void insert( NodePtr *dPtr, int value ); …

Member Avatar for kele1
0
143
Member Avatar for akim_atl

I am all confused, I don't where to start. This is my first programming class and i need some help please. Write a C program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of 10 dollars) and the machine dispenses this …

Member Avatar for virgo_norz
0
1K
Member Avatar for Iam3R

Hi, I used Enum constant as a case of swict statement and trying to select by using the pointer to the structure , which internally has a union and a enum member. the union member again internally have three structures. even i debugged the code. the value of the variable …

Member Avatar for Iam3R
0
94

The End.