Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

C/C++ Frequently Asked Questions


  • Please log in to reply
36 replies to this topic

#25 rela

rela

    CC Newcomer

  • Member
  • PipPip
  • 17 posts

Posted 16 December 2014 - 11:09 PM


Do you know how to open a command prompt?

Do you know how to use the "cd" command to move to the directory your executable is in?

No, can you please tell me from the beginning? 


Edited by rela, 16 December 2014 - 11:10 PM.

  • 0

#26 Alexander

Alexander

    YOL9

  • Moderator
  • 3963 posts
  • Location:Vancouver, Eh! Cleverness: 200
  • Programming Language:C, C++, PHP, Assembly

Posted 17 December 2014 - 12:28 AM

No, can you please tell me from the beginning? 

Consider making a thread in the General or C++ forum so we can discuss more on the topic. Before you do so, you can start by looking at common Windows/Linux command line functions and what they do, and how to run an executable from a directory with parameters (i.e. compiler options and the file to compile here.)


  • 0

All new problems require investigation, and so if errors are problems, try to learn as much as you can and report back.


#27 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 17 December 2014 - 05:43 AM

No, can you please tell me from the beginning? 

In windows (depending on the version), choose Run... and type in "cmd", or search and type in "cmd" that will allow you to launch the command prompt.

 

In that prompt, you can type "cd [folder name]" to go into a folder, "cd .." to go up one folder, and "dir" to get a list of files, and "[program name]" to run a program.


  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#28 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 17 December 2014 - 07:25 PM

In addition, while in command line, if  you need to address a folder or file which contains a space, wrap it on "" . For example

 

cd "my folder"

"my app.exe" (actually you don't need to write .exe, but it's more illustrative)

 

Also, most of commands, when fit, respond to the * wildcard, for example, if you need to change to the "my folder" folder, and it's the only one starting with m, you can use cd m* and it will work.


  • 0

#29 AlexMog

AlexMog

    CC Lurker

  • New Member
  • Pip
  • 9 posts
  • Location:Marseille - France
  • Programming Language:C, Java, C++, C#, PHP, Python, JavaScript, PL/SQL, Assembly, Bash, Others
  • Learning:Others

Posted 18 December 2014 - 11:00 PM

In addition, while in command line, if  you need to address a folder or file which contains a space, wrap it on "" . For example

 

cd "my folder"

"my app.exe" (actually you don't need to write .exe, but it's more illustrative)

 

Also, most of commands, when fit, respond to the * wildcard, for example, if you need to change to the "my folder" folder, and it's the only one starting with m, you can use cd m* and it will work.

TAB (autocompletion) is your friend too in that case. (m + TAB).

Actually, for the cd "my folder", in linux, you can use the \. (for example: cd my\ folder) I dont know if it is the same on windows.

 

Have fun!

 

Mog.


  • 0

#30 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 19 December 2014 - 05:59 AM

Depending on the windows version, you can shortcut navigation with wildcards:

 

if there is a long directory named: Projects for work, you can shortcut it by typing cd proj*


  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#31 KokoSamir

KokoSamir

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 02 January 2015 - 03:15 AM

Hi,  I am also having this problem where i need to add Strings into a tree list. I managed to get the program to read the file but i dont understand how to go through the file reading one string at a time and inserting it into the tree.   I have 1000 words and only can use a tree. I tried googleing it but could not find the right answer for my problem. IF someone can atleast point me in the right direction on how to iterate through the file it would be awesome. :)   Thank you.


  • 0

#32 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 02 January 2015 - 09:08 PM

For the line to line reading you need a  while( !feof( fileHandler) ) {  gets(); }

That is the pointer to read one string at a time.

About the tree, you should look for the tree's add/append methods, and use them.


  • 0

#33 charlesdavis

charlesdavis

    CC Regular

  • Member
  • PipPipPip
  • 34 posts
  • Location:Noida
  • Programming Language:C, C++, C#, PHP, PL/SQL, Visual Basic .NET
  • Learning:Assembly, Fortran, Prolog

Posted 07 May 2015 - 09:30 PM

can anybody tell me how to improve my programming skills.

In Programming, no body become perfect by following shortcut methods..If you are dedicated to learn the things so you will catch it practically only. 


  • 0

#34 Hoodaguba

Hoodaguba

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 09 May 2015 - 01:40 AM

Would anyone help me please to write a program in -[c] for two parallel resistors and one series resistors all together in one circuit.
  • 0

#35 charlesdavis

charlesdavis

    CC Regular

  • Member
  • PipPipPip
  • 34 posts
  • Location:Noida
  • Programming Language:C, C++, C#, PHP, PL/SQL, Visual Basic .NET
  • Learning:Assembly, Fortran, Prolog

Posted 10 May 2015 - 11:02 PM

I will simply say that it is really not simple language for big application but it is good for small programs and practices..


  • 0

#36 charlesdavis

charlesdavis

    CC Regular

  • Member
  • PipPipPip
  • 34 posts
  • Location:Noida
  • Programming Language:C, C++, C#, PHP, PL/SQL, Visual Basic .NET
  • Learning:Assembly, Fortran, Prolog

Posted 11 May 2015 - 09:52 PM

Just Follow the steps pleae:

 

Window-->Run-->Type(CMD)<------Enter

 

There you need to type CD Folder name  <-------Enter


  • 0