19,876 Topics

Member Avatar for
Member Avatar for symon_1

I have text file in D drive named "data.txt". It have several columns and rows like A B A B V B B V A B A A B B A A B A I want to read it and then convert it to say A=1, B=2, V=3 and then …

Member Avatar for Rahul47
0
238
Member Avatar for willyah

How do i write a program in C to do split and merge operation. I have configured my system with opencv.

Member Avatar for Suzie999
0
2K
Member Avatar for willyah

Am a beginner in C programme. How do I define two vectors of complex numbers with random valuee of size N. appling this code complex*vector=(complex*) malloc(sizeof(complex)*N)

Member Avatar for rubberman
0
161
Member Avatar for willyah

How can write a paralle program using the openmp threading library(omp.h) to calculate the time needed to calculate the dot product of two vectors.

Member Avatar for Ancient Dragon
0
187
Member Avatar for CHINMAYA_1

main() { int s=0; while(a && b && c) { s++; a--; b--; c--; } printf("%d",s); } i know that here a,b,c are undeclared, but beside that i can't find the problem. so anyone can help me out here. thanks

Member Avatar for rubberman
0
121
Member Avatar for willyah

Am beginner in C program how can i write a sequential program to calculate the wall clock time (time_t) needed to calculate the dot product of two vectors.

Member Avatar for rubberman
0
83
Member Avatar for radu.nuconteaza

//header file #ifndef STRUCT_H_INCLUDED #define STRUCT_H_INCLUDED typedef struct curs_valutar { char nume[50]; float cursul; struct curs_valutar* next; struct curs_valutar* next2; }curs_val; curs_val *head=NULL; int sc=0; int n; int creare(int n); void introducere_date(); int citire_date_fisier(char nume_fisier[100]); void afisare_date(); void eliberare_memorie(); int adaugare_date(char c_nume[100],float cursul); void cautare_date(char sir[100]); void cautare_date_in(int val1, int …

Member Avatar for Ancient Dragon
0
240
Member Avatar for Vish0203

Hi everyone, I know that we can pass string as command line argument and use it as we want. But, can we pass a text like "this or that" (with several spaces)?? Is there any way??

Member Avatar for Vish0203
0
95
Member Avatar for V3N0M

Hi everyone can anyone help me debug this code apparently it works on my mac and doesnt work on windows and codepad.org. Thanks in advance: //Tic_Tac_Toe game #include <stdio.h> #include <stdlib.h> /************************************ function prototype ***********************************/ void displayBoard(); int verifySelection(int, int); void checkForWin(); /************************ gloobal variables ***********************/ char board[9]; char cWhoWon …

Member Avatar for V3N0M
0
315
Member Avatar for bogoreh

hi everyone i am trying to write a program for a library system that allow stuff to add, remove, view and delete customer. i try to use file to store data and i open the file in mode read then i store then i put the content of the file …

Member Avatar for bogoreh
0
189
Member Avatar for bananacat

Hey there! I've been working on this code that uses linked list operations: #include<iostream> #include<conio.h> using namespace std; void displayRecords(); // done void searchRecord(string); // done void insertAtEnd(string, string, int); // done void insertAtBeginning(string, string, int); // done void insertAtSpecifiedLocation (string, string, int, int); // done void deleteAtEnd(); // somewhat …

Member Avatar for bananacat
0
169
Member Avatar for Rahul47

Here is my nifty program. #include<stdio.h> int main(){ char *str; str="Hello World!!"; puts(str); printf("\nEnter a new string: "); gets(str); // Is this right ? printf("\nString after entering: "); puts(str); // And this one ? getch(); return 0; } The program did printed "Hello World!!" but failed to take user input.

Member Avatar for Ancient Dragon
0
227
Member Avatar for aka619ASH

So the question is following: Given three integers as input determine if the values were entered in ascending order (from smallest to largest) and whether those values represent a Pythagorean Triplet.[Click Here](http://en.wikipedia.org/wiki/Pythagorean_triple) **Examples** *Enter the three values to test (a b c): 3 4 5 a < b < c …

Member Avatar for scudzilla
0
229
Member Avatar for momal

This is my question and I've managed to bring out an answer for part a, but for part b I'm not really confident about my answer of part b. In a recent court case, a judge cited a city for contempt and ordered a fine of $2 for the first …

Member Avatar for momal
0
2K
Member Avatar for Rahul47

Here is my code along with question in it. #include<stdio.h> int main(){ int i,a[2][3]={{1,2,3},{4,5,6}},*p=&a; printf("%d",p); // Printing the base value. printf("\n%d",p[4]); // Q) Does this means *(p + 4) ? printf("\n%d",p[5]); // Q) Does this means *(p + 5) ? getch(); return 0; }

Member Avatar for Rahul47
1
206
Member Avatar for dendenny01

How can I dynamically allocate the size of an arry at runtime When I am doing this am getting an error.. #include<conio.h> #include<stdio.h> void main() { int n; a[n]; clrscr(); printf("Enter no of your array\n"); scanf("%d",&n); printf("Enter your array"); for(int i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { printf("%d\n",a[i]); } }

Member Avatar for dendenny01
0
347
Member Avatar for vibhu mishra

i m trying to run a mp3 file on dosbox plateform by c .i put the following code in to the batch file start c:\xyz.mp3 and trying to call this as system("c:/a.bat"), the system funtion is returing 0 but it is not running it. But the same code working well …

Member Avatar for cgeier
0
346
Member Avatar for arlir

Hi there every body, i am trying to build this contact list to hold records for a purpoted library but i got a little stuck with a few issues that i would like you guys to look at. The fifth switch(delete) statement does behave strangely i should say. When I …

0
77
Member Avatar for arlir

Hi there every body, i am trying to build this contact list to hold records for a purpoted library but i got a little stuck with a few issues that i would like you guys to look at. The fifth switch(delete) statement does behave strangely i should say. When I …

0
84
Member Avatar for arlir

Hi there every body, i am trying to build this contact list to hold records for a purpoted library but i got a little stuck with a few issues that i would like you guys to look at. The fifth switch(delete) statement does behave strangely i should say. When I …

0
52
Member Avatar for overwraith

Is there any difference between returning a pointer to a struct, and returning a struct? Aside from the derefrenceing that is done would they both be working with the same struct? Is there any copying that gets done if it is just a regular return?

Member Avatar for overwraith
0
305
Member Avatar for Seba Sama

Hello, I need to start using databases with c++. I know in VB or VBA is simple and easy to find tutorials. I've done a lot of database apps in VBA and VB. I couldn't find help for c++, only for vc++. I use Code::Blocks and mingw. If anyone knows …

Member Avatar for Seba Sama
0
1K
Member Avatar for rat.man.9277
Member Avatar for vmanes
0
58
Member Avatar for Rahul47

I have two questions: 1) Here is a small program showing how one can use Array name as Pointer variable. #include<stdio.h> int main(){ int a[5]={1,2,3,4,5},i=0; for(i=0; i<5; i++){ printf("\nAddress: %d\tValue: %d", a+i,*(a+i)); } getch(); return 0; } If we can use array name as pointer variable, then why separately declare …

Member Avatar for Banfa
0
205
Member Avatar for Rahul47

Which one of the following is the smart, efficient and safe way to declare a string array ? And if you have any other way do suggest. char a[10]={'A','B','C'}; char a[10]="ABC"; char a[]="ABC"; char *a="ABC"; Please take into consideration the memory allocation and size, memory wasted, methods of retriving data …

Member Avatar for mathematician
0
131
Member Avatar for rocking.ganesh.9

Iam a student of computer science and i am in the first year of my college(I am studying computer science and engineering). I am thinking of doing a project in c++ which analyses the amount of oops concept used in a specific code. To speak more elaborately, I want to …

0
42
Member Avatar for Rahul47

Fairly easy pointer increment program is as follows. #include<stdio.h> int main(){ int i,a[10],*p=a; for (i=0; i<10; i++,p++){ printf("\nAddress of a[%d] is %d",i,p); } getch(); return 0; } Here is output: Address of a[0] is 2293488 Address of a[1] is 2293492 Address of a[2] is 2293496 Address of a[3] is 2293500 …

Member Avatar for Ancient Dragon
0
231
Member Avatar for H_beginner

I am using the gcc compiler and I am new to using flags. Can any one tell me a source for it. e.g. I wanted to use *-funroll-loops* but I dont know the proper syntax. Can any one help.

Member Avatar for L7Sqr
0
252
Member Avatar for Rahul47

The expected outcome dosent agree with result. Following is the code snippet. int a,c; a=10; c=0; c=(--a)+(--a); printf("C: %d", c); printf("\nValue of a: %d", a); I expected C to be 17 i.e (9+8), but it comes out to be 16. And a becomes 8 as expected. When expression is changed …

Member Avatar for N1GHTS
0
413
Member Avatar for V3N0M

Hi there I am currently teaching myself C and I have to create a program with a 2d array that receives upto 5 names and prints them out. No pointers should be used :(. So I am wondering can anybody help me with this. #include <stdio.h> int main(int argc, const …

Member Avatar for V3N0M
0
150
Member Avatar for Oremuss

Hi guys , I have to do simple brute force program for my homework and I dont know what to do. It should work when I put there some password(max. 4 letters for examle: azxd ) and the program should start to trying every possible combination one at time like …

Member Avatar for Oremuss
0
209
Member Avatar for H_beginner

Can anyone please tell me how can I do loop unroll void do_block (int lda, int M, int N, int K, double* A, double* B, double* C) { /* For each row i of A */ for (int i = 0; i < M; ++i) /* For each column j …

Member Avatar for H_beginner
0
295
Member Avatar for shakin

** # import a data table with space? # ** Good day! I need to read in all the data in a file within column two and export it in a file. The issue is the data is not standard and has blank fields from time to time. It also …

Member Avatar for N1GHTS
0
260
Member Avatar for kristina.densmore

I just started programming in C our first asssignment is writing an alogrithm to compute the volume of water in cubic feet, flowing through a pipe of diameter d in feet, with a velocity of v feet per second, give this fomula r=d/2 area=pi x r squared volume = area …

Member Avatar for cgeier
0
480
Member Avatar for shaneetra.graham

I'm buidling my own shell and I was trying to implement a history function, but was a little lost on where to start. I know i would like to use a for loop to go through list, I'm just having trouble on where to store it.

Member Avatar for N1GHTS
0
130
Member Avatar for radu.nuconteaza

#include <stdio.h> #include <conio.h> #include <stdlib.h> struct exchange_rate { char name[50]; float rate; }; int main() {struct exchange_rate x[50],adaus,caut[20],aranj; int i,n,q,k,z,d; float aux,max; char w; int lungime; FILE *f1; //afisam meniul m0: system("cls"); printf("\n\t\t***MENIU***\n\n"); printf("\t1: Filling database.\n"); printf("\t2: Reading the database file\n"); printf("\t3: Introducing a new registration\n"); printf ("\t4: Cautarea …

0
111
Member Avatar for visakh_Here

Iam beginer in this field. While trying a code to implement fprintf & fscanf, iam getting errors. Please help to explain the cause of error. Code Snippet ================ #include <stdio.h> int main () { FILE *fp; int num; char sstr[100]; fp = fopen("myText.txt", "w"); fprintf(fp,"%d %s",9898,"visakh"); /*sscanf(fp, "%f %s",&ffloat,sstr); printf("Float …

Member Avatar for mathematician
0
120
Member Avatar for Chair

Hi, can someone pls help me. I'm trying to pass the name of the user who logs in from a login form and display his/her name on a Main form. I'm using get{} and set{}. My problem is with the function I'm trying to create to return the name of …

Member Avatar for pritaeas
1
9K
Member Avatar for glenc70

i am making my own trainers for games using c++, one of the main functions i use is the WriteProcessMemory but this is all good if you know the byte codes for the instructions i want to change like the nop instruction is 0x90 for example (DWORD) instructioncode = "0x90"; …

0
86
Member Avatar for Adeel Rahat

i am using turbo c++ 3.0 but it has not good graphics.i try visual studio and dev c++ but its syntax is changed. i want a compiler that has same syntax like turboc++. plz name it and give me a dowload link for 64bit os.

Member Avatar for ddanbe
0
328
Member Avatar for mustafa.bahaa

hay guys iam new to c++ programming studing for c++.com iam getting to a point that i wirte a program and it doesn't run and i can't find anything realted to it , to know where is the problem so that's the program // cin with strings #include <iostream> #include …

Member Avatar for mustafa.bahaa
0
220
Member Avatar for arjun.godara.549

hi, i am begginer, want some help in following questions. 1.write a program for to store five values in array and print them using loop. 2.write a program for to store and display the 2D array. 3. print diagonal element of matrix.

Member Avatar for Ancient Dragon
0
83
Member Avatar for khan shahid
Member Avatar for tauqeer381

I want to make an import export company desktop application. But i am getting problem in making the design of the application. can anyone please help me regarding this???

Member Avatar for Maligui
0
182
Member Avatar for Van_1

Hi. I just got a problem running my graphics program written using C language in DOS Box. There may seem a problem using the graphics.h running through DOSBox in Windows 7 ultimate 64bit. The program just flickers fasts when I run it. I know that my program is correct and …

Member Avatar for N1GHTS
0
407
Member Avatar for sumdumhoe

Apperently there is an undeclared identfiier "stdprn". Please help /* PRINT_IT.C-This program prints a listing with line numbers! */ #include <stdio.h> void do_heading(char *filename); int line, page; main( int argv, char *argc[] ) { char buffer[256]; FILE *fp; if( argv < 2 ) { fprintf(stderr, "\nProper Usage is : "); …

Member Avatar for Ancient Dragon
0
201
Member Avatar for nitish.mohiputlall

I am having 4 errors with the main program and i dn't know how to slove it anyone to help me how to solve the errors and how the codes was suppose to be correctly typed: 1.error: 'salaried' was not declared in this scope (line 5) 2.error: expected primary expression …

Member Avatar for Moschops
0
2K
Member Avatar for asmaa_4

I Want to know that what the difference between int and longint is Although they have the same siza (4 bytes)

Member Avatar for yasir prince
0
114
Member Avatar for kent.johnstone_1

Is this a "typedef" problem? This is the definition in one file. typedef BYTE SOCKET; //Socket descriptor BYTE is defined elsewhere as type char. (I made sure the file where SOCKET is assigned a type is included in the file the problem is in.) This is one place it is …

Member Avatar for kent.johnstone_1
0
330
Member Avatar for mexabet

I'm creating a basic C program that I want to accept both positive and negative inputs. However, as it is it doesn't accept negative inputs. Any help on how to fix it will be much appreciated. here is the code: int main(void){ // Here we declare integer and floating point …

Member Avatar for mexabet
0
308

The End.