15,550 Topics

Member Avatar for
Member Avatar for drjay1627

how do i concatenate a an array. This is the code. [code] char data [128]; char c, s, l; char *cmd_array [128]; count = 0; char * pch_W; pch_W = strtok ( inbuf, " " ); while ( pch_W != NULL ) { cmd_array_W [ count ] = pch_W; pch_W …

Member Avatar for drjay1627
0
163
Member Avatar for newbiecoder

Hi I want to write a program which reads a hexadecimal number and returns an decimal number. I wrote that code(inspired by some code pieces from web): [CODE]#include <stdio.h> int main() { int hexa; scanf("%x", &hexa); printf("%d", hexa); return 0; } [/CODE] but it does't give the answer I want …

Member Avatar for WaltP
0
103
Member Avatar for BruenorBH

I am getting the above error when trying to compile.. main.cpp [code=cplusplus] #include <windows.h> #include <string> #include "resource.h" #define GETITEM(item) GetDlgItem(hWndDlg, item) static bool keeprunning = true; static bool keeprunning1 = true; static bool keeprunning2 = true; static void run(); static void breakrun(); static void lunchrun(); static void end(); static …

Member Avatar for BruenorBH
0
244
Member Avatar for EMUGOD

[code=c]printf("reading input image ... \n"); /*unidata.image = (image_ptr*)read_pnm(argv[1], &(unidata.rows), &(unidata.cols), &type); */ printf("hello.jpg"); printf("image read successfully \n"); printf("rows=%d, cols=%d, type=%d \n", unidata.rows, unidata.cols, type); /* error here*/ printf("well"); [/code] the errors are coming between the two final printf statements. when the read_pnm() is left uncommented it is a segmentation fault, …

Member Avatar for EMUGOD
0
172
Member Avatar for surender_kumar

Hi friends Please help me with suitable code snippets to simulate a 2-server queue in C.

Member Avatar for John A
0
90
Member Avatar for dzoch89

Hello, I am currently working on a program which will take a set of strings from a data file and store them into an array called word. So far my code has compiled correctly however I just added in malloc and it just doesn't like me. I need to malloc …

Member Avatar for Ancient Dragon
0
117
Member Avatar for surender_kumar

Hi friends I have an problem in C with simulation of Inventory problem. Help me with suitable code...

Member Avatar for William Hemsworth
0
56
Member Avatar for ssDimensionss

Hi i have a program that outputs a bunch of hexadecimal numbers. Here is a example: 18 3048 ffff8007 The thing is i want all the outputs to be 8 digits long, so i want the out put to be something like: 00000018 00003048 ffff8007 so yea basically i just …

Member Avatar for Narue
0
209
Member Avatar for ssDimensionss

hi guys im working on making a program where u get given a machine code. The first 6 bits are the opcode, the next 5 bits is the source register, the next 5 bits is destination register and the last 16bits is the immediate. What we have to do is …

Member Avatar for ssDimensionss
0
212
Member Avatar for moiron

how do I get the maximum, minimum and the average of an array? this may be different but how do I get to stop inputting number in an array. for example if the array is 20 and i only need 10 of them. i think its something about EOF but …

Member Avatar for moiron
0
248
Member Avatar for alexms

hey, im having a problem getting file stored into linkedlists. the program crushes when start reading. [B]these are the structs:[/B] [code=c]typedef struct category { char categoryID[5]; char categoryName[25]; char fareType; char categoryDescription[250]; unsigned numItems; ItemTypePtr headItem; //ptr to item struct CategoryTypePtr nextCategory; } CategoryType; typedef struct item { char itemID[5]; …

Member Avatar for nexocentric
0
2K
Member Avatar for Tunca

I have been working on my final project that i am going to do a simple soccer game. Not graphical. I will ask the user to choose or create a team. Teams are saved in the same file as the code as text files. where i am stuck is, i …

Member Avatar for jephthah
0
102
Member Avatar for niku4u

Following is my client code....I am receiving data of equal size of JPG file... so if anyone can help me out with reading buffer properly and writing it in to jpg file at client side ================================================ do { memset(buffer,0x0,BUFFER_SIZE); // init line rc = read(sd, buffer, BUFFER_SIZE); if( rc > …

Member Avatar for niku4u
0
490
Member Avatar for DJInsane

I am trying to write a program for my school assignment, but this programming thing is extremely hard, so I am looking some help in getting it done. The program i am writing is a basic grading system, where it should show the students class, and grade, and also calculate …

Member Avatar for jephthah
1
344
Member Avatar for newbiecoder

Hi, I am expected to use sscanf function in a program, but I couldn't understand how it works. Can you explain it with an easy example? Thanks -- newbiecoder

Member Avatar for newbiecoder
0
147
Member Avatar for Valaraukar

Hi, I've written a program that reads object information from an ASCII file (exported from 3dsmax) so that an object/objects can be reproduced in OpenGL. It works fine at the minute and can read multiple objects from a single file but what I want to be able to do is …

Member Avatar for Valaraukar
0
285
Member Avatar for BruenorBH

I am new to Win32 API and am having trouble setting up the menu. Here is what I have at the moment (my new way of doing the main.cpp code is from another member) but I cannot understand where to put in the function call for the menu.. main.cpp [code] …

Member Avatar for nucleon
0
161
Member Avatar for gmark

Dear all, I have read a lot topics about reading binary files but I didn't find something about my problem. How possible is it to read a binary file that you don't know the file format? I am sure that there are at least chars and float numbers. Thanks a …

Member Avatar for gmark
0
2K
Member Avatar for xyster

Hello again, got myself stuck again with my lack of time between coding c. Gotten myself lost with pointers this time i'm pretty sure. Declaration in header file [code=c] extern DiskRequest proc_new_disk_request(int procnum, int sectornum, ReadOrWrite rw); [/code] Where i'm calling it from and some code around it to make …

Member Avatar for xyster
0
144
Member Avatar for zoner7

If you look at the end, i try to store some values in a few arrays. When i try to print these out, I receive complete junk. any thoughts? [CODE=C++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define MAX 122 #define MIN 48 char GetRand(); void RC4(char *realpw, char …

Member Avatar for Aia
0
98
Member Avatar for oNice

I'm trying to create a cipher that eventually will read an entire .dat file then re-write it encrypted and as of now I am using code blocks. Right now I’m just working on being able to do it one word at a time, but I get a really big error …

Member Avatar for oNice
0
94
Member Avatar for bunnyboy

Hello! So, I have a problem with the following code... I'd like to know, why the variables pid and ppid are not initialized? Inside the if scope, if I print them out, they are initialized to getpid() and getppid() value, but when I want to print them out in else …

Member Avatar for bunnyboy
0
113
Member Avatar for BruenorBH

I am using GetWindowText to take user entered data, then seperate it out into variables, then finally use the one variable I need. .The only problem is that when debugging, I am seeing 2:00 pm listed as "2:00 pm", '\0' <repeats 17 times> it should just be 2:00 pm or …

Member Avatar for nucleon
0
143
Member Avatar for xyster

Hello, It's been ages since i've coded in c and i'm assuming im having a problem with the syntax. I am sure this is stupid and very in my face but i cant seem to work out my errors at compile time. disk.c: In function `update_rw_requests': disk.c:531: error: `rw' undeclared …

Member Avatar for xyster
0
158
Member Avatar for Trendkiller

I've got some of my project finished. This is supposed to 1) check to see if each word in the input file is a palindrome using stacks 2) If the word is a palindrome, write the word to a separate output filr. 3) Count the number of words read and …

Member Avatar for Trendkiller
0
268
Member Avatar for ubipg

Hi all, i have a problem which is i want to call function in different .cpp file.i create .h file. in main function, i include xxx.h as header file.in xxx.h i list down all the functios inside the file with extern.than in xxx.cpp i declare variable like dis e.g extern …

Member Avatar for ubipg
0
238
Member Avatar for zoner7

If you run this code, you will see that the first two lists values do not show up. I'm pretty sure this is because I am trying to print chars as numbers. I'm just wondering how to do this. Thank you. [CODE=C++] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> …

Member Avatar for Ancient Dragon
0
137
Member Avatar for zoner7

So I've got a program that takes an encrypted file and essentially decrypts it. I am now trying to modify this file. During the encrypting process, the words were scrambled by position. The location of each word is marked with a position value. I decrypted the original text, so now …

Member Avatar for nucleon
0
110
Member Avatar for BruenorBH

I am getting error that I am doing an invalid conversion from int to char. I am using sprintf to change a user entered hour called ETHour to char, then strcat more chars onto it to create a time then trying to post it to a window.. [code] char cETime[8], …

Member Avatar for BruenorBH
0
326
Member Avatar for TheBeast32

Hi, how would I get the temperature and percentage of load for my CPU, GPU, and other things like the hard drive? I'm on Windows XP. Is there something in the Win32 API or what?

Member Avatar for jephthah
0
3K

The End.