18,491 Topics

Member Avatar for
Member Avatar for moroccanplaya

hi i can copy text based files to other files but when it comes to images i cant copy them it gives me a distorted image. [CODE] printf("please give your archive a name:\n"); scanf("%s", &archive_name); create_pointer = fopen( archive_name, "wb"); printf("please type in the path for the file you want …

Member Avatar for moroccanplaya
0
98
Member Avatar for tomtetlaw

Is there a way to ensure that all un-initialized pointers automatically have the address 0x00000000? Sometimes they're being set to other addresses but still being unitialized, and they pass tests like if(!ptr), causing an unhandled access violation error.

Member Avatar for tomtetlaw
0
113
Member Avatar for e!sa

ok here's the current situation:sprintf(blah, "%c%-.6s%c", QUOT, varName, QUOT);my question is, how can i use a variable instead of that 6 in there?because i'm supposed to print a whole bunch of strings with variable size (

Member Avatar for Sumanth13
-1
111
Member Avatar for sciprog1

Hello Members, I am trying to understand the pipe() system call. I found this program online: [CODE] #include <unistd.h> #include <stdio.h> #define MSGSIZE 16 char msg1[] = "hello #1"; char msg2[] = "hello #2"; char msg3[] = "hello #3"; main() { char inbuf[MSGSIZE]; int p[2], j; /* open pipe */ …

Member Avatar for sciprog1
0
198
Member Avatar for dubery

Hi all I need to write a recursive function that displays every permitation of NxN numbers this example uses 3x3 and will display 0 1 0 1 1 0 2 1 0 0 2 0 1 2 0 2 2 0 0 0 1 1 0 1 2 0 1 …

Member Avatar for dvillase
0
138
Member Avatar for frankchester

When I run this program, and the file can be found, it works fine. However when the file is not there I get the error: Debug Assertion Failed! Expression (str != NULL) It seems to be a problem with the following loop as when its remove it works fine: [code=c] …

Member Avatar for Perry31
0
259
Member Avatar for Rickay

[CODE]#include <iostream> #include <windows.h> #include <ctime> using namespace std; double time1; int main() { const double seconds1 = time(0); string string1; while(1) { long double seconds2 = time(0); if(seconds2 == seconds1 + 5) { cout << "Five seconds went by.\n\n"; break; } } cin.clear(); cin.ignore(255, '\n'); cin.get(); return 0; }[/CODE] …

Member Avatar for Rickay
0
249
Member Avatar for jt_murphree

I am not sure if this is the right place to post this or not. I have a C application that I have written for linux that I would like to write a GUI for. I am trying to get up an running using GTK. Can anyone direct me to …

0
70
Member Avatar for Hassan.shah

hi need to write a program to read or write data to PLc by rs232 using modbus protcol how can i do it Thanks in Advance

Member Avatar for daviddoria
0
142
Member Avatar for alexchen

"Why does this not compile?" [CODE]int main(){ struct people{ char name[20]; short age; } people; struct people me; cout<<"Write your name"<<endl; gets(me.name); cout<<"How old are you"<<endl; gets(me.age);//error }[/CODE]

Member Avatar for alexchen
0
158
Member Avatar for NinjaLink

Hi I am trying to compile and run my prog3.c program, but I am getting the compiler errors below. I have tried to reference the information by doing #include "node0.c" etc., but no luck. Any ideas on how to fix this problem? I attached the files below that I am …

Member Avatar for Perry31
0
281
Member Avatar for tomtetlaw

I am using Windows XP 32-bit, VC++ 2008 with OpenGL and the Windows API. When I run my program, it seems to work fine, but whenever I click anywhere on the title bar of the window, the program exits. I have no idea where to start to look for the …

Member Avatar for tomtetlaw
0
189
Member Avatar for Fredszky

Im trying to make my program to either open or create a file if it does not exist, in "C://". [code] printf("Filename: "); scanf("%s",filename); FILE *fil; fil=fopen(filename,"a+");[/code] This code opens or creates a file in the same folder as the program. What i want is something like this: [code] printf("Filename: …

Member Avatar for vinitmittal2008
0
201
Member Avatar for kousamir

Hello, i'm new to this forum and this's my 1st time posting a code. my issue is that i have a code that should read from a file called ( ex: word or text), but it does not read the file it jUst gives me the error (could not open …

Member Avatar for kapilsolanki84
0
275
Member Avatar for ScreamingPsycho

Hello, first time here.This program reads in a file of different names and uses void options to put them in various order. On line 111, 116, 121, 126, 131, I am not sure what to put inside the parenthesis. [EX: option1(NotSureWhatToPut)]. I have tried to put 'nextStudent' and get a …

Member Avatar for ScreamingPsycho
0
210
Member Avatar for berwick53

Hi i've just started to use constructors and I'm having some problems with the following code with data not saving(saving to the correct place) please Help :( [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> typedef struct details // struct for all data { char name[50][50]; char card[50][16]; long sort[50], …

Member Avatar for gerard4143
0
120
Member Avatar for papori

hey, i create a segment , then i attach it to data space, now i want to put the array in this space what sould i do next? how to assign it into? int shmid , size=5; int *shm; int array[] = {1,2,3,4,5}; // Create the segment. if ((shmid = …

0
55
Member Avatar for dalaharp

hi, i have to rotate an image. the image is stored in an image[rows][cols] array.. i am trying to rotate it using trignometric functions. i am not sure what happens when i rotate the image, does the address of the pixel vary or the value of the pixel vary. and …

Member Avatar for arielbernal
0
3K
Member Avatar for jeremy62

Alright im trying to create a program that allows the user to input numbers into an array and then will take the average of all the numbers within the array but im getting very strange results any help is much appreciated [CODE]#include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) …

Member Avatar for darkbreaker
0
164
Member Avatar for NinjaLink

Hi I am trying to compile and run my prog3.c program, but I am getting the compiler errors below. I have tried to reference the information by doing #include "node0.c" etc., but no luck. Any ideas on how to fix this problem? I attached the files below that I am …

Member Avatar for NinjaLink
0
307
Member Avatar for quangvn

Hi, I'm a newbie to programming in general. I want create two functions to read and write dat from one file to another file. Function read will read dat from file to buffer, and funtion write these data from buffer to another file. These functions work parallel, it means: Function …

Member Avatar for Shankye
0
174
Member Avatar for westony

I have this code in here: [CODE]#include <stdio.h> #include <conio.h> #include <string.h> void array_input(int *a) { int i=0,n,p; printf("How many items you wanna input? : "); scanf("%d", &p); for(n = 0; n <= 99; n++) if(*(a+n) != 0) i++; for(i; i<(i+p); i++) { printf("Enter %d number:",i); scanf("%d", &(*(a+i))); } } …

Member Avatar for Shankye
0
120
Member Avatar for ExCard

hi guys i need some help can you guys help me at deleting nodes I'm not yet that good in linked list and I can only delete the first node but I can't delete nodes in the middle and at the last help please I'm making a student database where …

Member Avatar for vinitmittal2008
0
108
Member Avatar for PREETHIBCA

[B][I][/I][/B]:)[color="red"][/color]this is preethi from chennai.. I have done bachelor in computer applications. But to be frank i dont know much about computers. I take this community as my tutor and i hope you guys will help me. Actually i have a passion for programming.. But i dont know how to …

Member Avatar for RichardCohn
0
116
Member Avatar for kalpana sathiya

plz.. help me .. how to arrange the set words in aphabetical order in c.its confusing me

Member Avatar for kalpana sathiya
0
81
Member Avatar for protas

Hi Guys, Wanted some help with my code. This should be the OUTPUT. Enter the size of your array: (array size should be 1-100) Enter values of your array: x[0]= (any integer) x[1]= (any integer but not equal to the value of x[0]) x[2]= (any integer but not equal to …

Member Avatar for protas
0
162
Member Avatar for onus

I am trying to understand how can I make a graph in C. So I wrote some program. [CODE=c]#include "declarations.h" graph root = NULL; int main() { cgraph(); } void cgraph(void) { int n, choice, dir, count,sib; choice = 1; count = 1; graph priv, temp; printf("Printf we are making …

0
95
Member Avatar for MarounMaroun

Hello guys, I'm a 2 year computers engineering student. I'm a good programmer in c, c++ and java. MY mission is to create a software(with a graphical interface) that handles an electronics shop. My software should know how to insert an item, to delete it, to check if expired or …

Member Avatar for everhett.raman
0
149
Member Avatar for hobokook

Hi, I have an assignment where I have to implement a singly linked list of integers. Can you look at my pop front function below to see if it would work. I think it works, but I get this weird error whenever I test it. Also, how would I do …

Member Avatar for group256
0
191
Member Avatar for writt

how to store the info of student in the linked list PROGRAMS 3 0.4 LABS 3 0.1 EXAMS 3 0.5 Student Student 1234 PROGRAMS 90 85 88 LABS 99 65 85 EXAMS 67 85 56 John lastname 3456 PROGRAMS 95 90 98 LABS 91 75 90 EXAMS 55 63 92 …

Member Avatar for Ancient Dragon
0
119
Member Avatar for jeremy62

Im attempting to write a program that will accept seperate sales amounts from the user and then will total the sales and display both the total sales and the sales tax from the sales at the programs end, if you can provide any help or insight i would greatly appreciate …

Member Avatar for Ancient Dragon
0
233
Member Avatar for bkoper16

I am doing a project where i have to insert a list of players and stats into a binary search tree Here is the project description For this final assignment, you will be creating a binary search tree. You will be able to utilize some of your previous assignment code, …

Member Avatar for bkoper16
0
894
Member Avatar for harikrishna439

Can we print rational numbers instead of decimal ratios? for example, a=3; b=4; if we print a/b, we have to get 3/4 instead of 0.75

Member Avatar for sharathg.satya
0
126
Member Avatar for frankchester

Hi, I'm a newbie to programming in general and I'm really struggling with working out how on earth to do this! I am aware of how to open the stream and read the text file using fscanf, however I want to store the text in that file into a string …

Member Avatar for frankchester
1
39K
Member Avatar for ram619

Below shown is a simple C Code. The code which is troubling is in commented area (please remove comment symbol to run those lines, comment symbl is just here to highlight them), here there are two printf's in comment area......... the error is that both are getting executed continuously without …

Member Avatar for ram619
0
204
Member Avatar for jvill

I'm trying to write a program that will accept input from the user as sales, then it will total the sales and display both the total and the sales tax (total multiplied by .0825 [CODE] #include <stdio.h> #include <stdlib.h> #define SIZE 9 int main(void) { /*initialize */ int a[SIZE]= {0}; …

Member Avatar for erroldo
0
208
Member Avatar for wu_weidong

Hi all, I am just learning DMA, and am supposed to write 2 functions utilizing the offset technique, such that a 2-D array starts and ends the index of each dimension as the user specifies. matrix(): creates a 2D array of float type numbers, indexing from -n to n for …

Member Avatar for erroldo
0
261
Member Avatar for userpl

Hello This program read file and then it uses strcspn() to split strings. It displays words. I'd like to modify program now to check if variable "moja" equals some of words in "pairs.txt". If that's true, user should can write into "moja" every word from "pairs.txt" except words being in …

-1
49
Member Avatar for jvill

Alright im trying to write a fairly simple c program that will accept input from the user for both a number and a power to raise it to then display the result, it works up to the input part but the result is always some crazy number, im looking for …

Member Avatar for jvill
0
154
Member Avatar for nidhi.singh88

I wish to write a program ini C that calculates the depth of a binary tree. Can anyone help?

Member Avatar for prvnkmr194
0
63
Member Avatar for tdba.316

Hey :D this is my first post here^^, and it's a problem with an exercise from the book C++ Primer Plus, which I have been self-studying (I'm the beginner). The following code is how I did the exercise, which is in the header comment. It was built in VC++ 2010, …

Member Avatar for tdba.316
1
1K
Member Avatar for SpyrosMet

hi everyone I have a problem with a server - client project i have built. At first I made it work by forking and using shared memory. Then i had to replace those things with threads and the problem is that i don't know how to attach the client to …

0
66
Member Avatar for sciprog1

Hello Members, The wait() system call is illustrated to be used as follows: [CODE] int status, pid; /*fork a child process*/ /*parent is waiting for the child to terminate*/ pid = wait(*status) [/CODE] What exactly does the pointer to the "status" variable do when "status" has not even been assigned …

Member Avatar for sciprog1
0
266
Member Avatar for Madawar

Hello i want to create a file crawler that lists all files in hard disk using directory functions in C i have been able to list files in one directory only and haven't been able to crawl through other directories and sub-directories this is what i have so far. [CODE] …

Member Avatar for Madawar
0
435
Member Avatar for ritcherjd

I have a problem at hand. It is to generate a C code - i need to do the following, i will capture an image, then i have to this image into an array using C on which i can do some image processing. How do i go about it? …

Member Avatar for angelique28
0
1K
Member Avatar for arineon

I am trying to come up with my own code for strcat. This is what I have so far. I'm getting a segmentation fault and i can't figure out why. The function prototype and call must not change. Any suggestions? [CODE]//Function Protoype char* stringCat(char *pWord, char *pTemp); //Function call in …

Member Avatar for darkbreaker
0
166
Member Avatar for vkumarg89

Hiiii Everyone !!!! My name is Vaibhav Grover . I am 21 years old studying Engineering in Delhi, India . My hobbies include Reading , Playing both indoor and outdoor , Listening Music , Going out with Friends and Working out . MY intrests include C,C++,Oracle(mainly dbms) I am CCNA …

Member Avatar for WASDted
0
92
Member Avatar for moroccanplaya

hi has anyone know detailed info on the mkdir function plus the open dir and how to use it ?

Member Avatar for moroccanplaya
0
150
Member Avatar for Shaabangbang

Hi guys, i have to create a program that would store a persons full name, phone number, address, and postal code into a file named contactlist.dat, so far no problems, but im also supposed to use char for every single one, even the phone number, does anyone know how to …

Member Avatar for mfaisalm
0
269
Member Avatar for shinsengumi

Hi everyone. I'm using sqlite3 in Linux and I currently have a problem. I have a database and 2 tables in it: db1 and db2. db1 has 3 columns: empID, empName, empAddr. db2 has just 1 column: empID and its value is set to 0 by default. I created a …

Member Avatar for shinsengumi
0
592

The End.